From: Zac Medico Date: Mon, 6 Jun 2011 02:52:42 +0000 (-0700) Subject: portageq: support --version X-Git-Tag: v2.2.0_alpha38~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=81bd25882a4e3dc39751e915fecadae7d7368662;p=portage.git portageq: support --version --- diff --git a/bin/portageq b/bin/portageq index 92719fb5b..fa713889a 100755 --- a/bin/portageq +++ b/bin/portageq @@ -719,13 +719,18 @@ def main(): if nocolor in ('yes', 'true'): portage.output.nocolor() - if "-h" in sys.argv or "--help" in sys.argv: - usage(sys.argv) - sys.exit(os.EX_OK) - elif len(sys.argv) < 2: + if len(sys.argv) < 2: usage(sys.argv) sys.exit(os.EX_USAGE) + for x in sys.argv: + if x in ("-h", "--help"): + usage(sys.argv) + sys.exit(os.EX_OK) + elif x == "--version": + print("Portage", portage.VERSION) + sys.exit(os.EX_OK) + cmd = sys.argv[1] function = globals().get(cmd) if function is None or cmd not in commands: