some things for the install skript

This commit is contained in:
2015-12-05 11:02:03 +01:00
parent 90daa36bad
commit e0d0a263af

View File

@@ -1,29 +1,26 @@
#! /usr/bin/env python3
"""Naval Fate.
import os
import shutil
from pathlib import Path
from docopt import docopt
from subprocess import check_call
HELPTEXT = """{progname}.
Installs symlinks, plugins, plugin managers, ...
Usage:
{progname} ship new <name>...
{progname} ship <name> move <x> <y> [--speed=<kn>]
{progname} ship shoot <x> <y>
{progname} mine (set|remove) <x> <y> [--moored | --drifting]
{progname} [-f] [-p <dir>] install all
{progname} [-f] [-p <dir>] install vim
{progname} (-h | --help)
{progname} --version
Options:
-h --help Show this screen.
--version Show version.
--speed=<kn> Speed in knots [default: 10].
--moored Moored (anchored) mine.
--drifting Drifting mine.
-h --help Show this screen.
-f --force Force install if files look already installed
-p --path=<dir> Path to the dotfiles repo [default: .]
""".format(progname="install_files")
import docopt
import os
import sys
from pathlib import Path
from subprocess import check_call
import shutil
def install_vim(pdotfiles, force=False):
@@ -60,5 +57,7 @@ def install_vim(pdotfiles, force=False):
pvundle.as_posix()])
if __name__ == "__main__":
arguments = docopt(__doc__, version='0.1')
print(arguments)
args = docopt(HELPTEXT, version='0.1')
if args["install"]:
if any((args["all"], args["vim"])):
install_vim(Path(args["--path"]).resolve(), args["--force"])