From e0d0a263af9c00eb660c50d296c2a155361e0153 Mon Sep 17 00:00:00 2001 From: Peter Dahlberg Date: Sat, 5 Dec 2015 11:02:03 +0100 Subject: [PATCH] some things for the install skript --- install_files.py | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/install_files.py b/install_files.py index 26eea3e..528c4d6 100755 --- a/install_files.py +++ b/install_files.py @@ -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 ... - {progname} ship move [--speed=] - {progname} ship shoot - {progname} mine (set|remove) [--moored | --drifting] + {progname} [-f] [-p ] install all + {progname} [-f] [-p ] install vim {progname} (-h | --help) - {progname} --version Options: - -h --help Show this screen. - --version Show version. - --speed= 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= 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"])