From 16f324ff78d3667dd82d6053c9ad5a755115f6d8 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Thu, 20 Aug 2020 11:10:55 -0700 Subject: [PATCH] Add helptext to gitcheckup. --- gitcheckup.py | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/gitcheckup.py b/gitcheckup.py index 1263fcb..8f354a9 100644 --- a/gitcheckup.py +++ b/gitcheckup.py @@ -1,8 +1,35 @@ +''' +This program helps you check the commit and push status of your favorite git +repositories. The output looks like this: + +[ ][P] D:\\Git\\cmd (~1) +[C][P] D:\\Git\\Etiquette +[ ][P] D:\\Git\\voussoirkit (+1) +[C][ ] D:\\Git\\YCDL (↑3) + +To specify the list of git directories, you may either: +- Create a gitcheckup.txt file in the same directory as this file, where every + line contains an absolute path to the directory, or +- Pass directories as a series of arguments to this program. + +flags: +--fetch: + Run `git fetch --all` in each directory. + +--pull: + Run `git pull --all` in each directory. + +Examples: +> gitcheckup +> gitcheckup --fetch +> gitcheckup D:\\Git\\cmd D:\\Git\\YCDL --pull +''' import argparse import os import subprocess import sys +from voussoirkit import betterhelp from voussoirkit import dotdict from voussoirkit import winwhich @@ -197,9 +224,8 @@ def main(argv): parser.add_argument('--pull', dest='do_pull', action='store_true') parser.set_defaults(func=gitcheckup_argparse) - args = parser.parse_args(argv) try: - return args.func(args) + return betterhelp.single_main(argv, parser, docstring=__doc__) except GitCheckupException as exc: print(exc) return 1