From: Mike Frysinger Date: Thu, 8 Mar 2012 20:19:55 +0000 (-0500) Subject: dispatch-conf: add --help/--version flags X-Git-Tag: v2.2.0_alpha91~23 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=aec36182da4f1f0e754cc53ab9f8dd08c0ff9a28;p=portage.git dispatch-conf: add --help/--version flags Signed-off-by: Mike Frysinger --- diff --git a/bin/dispatch-conf b/bin/dispatch-conf index 75e991189..a77811881 100755 --- a/bin/dispatch-conf +++ b/bin/dispatch-conf @@ -459,6 +459,19 @@ def spawn_shell(cmd): else: os.system(cmd) +def usage(argv): + print('dispatch-conf: sane configuration file update\n') + print('Usage: dispatch-conf [config dirs]\n') + print('See the dispatch-conf(1) man page for more details') + sys.exit(os.EX_OK) + +for x in sys.argv: + if x in ('-h', '--help'): + usage(sys.argv) + elif x in ('--version'): + print("Portage", portage.VERSION) + sys.exit(os.EX_OK) + # run d = dispatch ()