emerge_main: use parse_opts for --help
authorZac Medico <zmedico@gentoo.org>
Tue, 16 Oct 2012 22:16:22 +0000 (15:16 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 16 Oct 2012 22:16:22 +0000 (15:16 -0700)
pym/_emerge/main.py

index ef94a4760163d16d7b8866069c8d4cdeb0ea0732..d31d99ae4b2b09550a876bd40a6dc0c44c638ce5 100644 (file)
@@ -961,12 +961,6 @@ def emerge_main(args=None):
        # Disable color until we're sure that it should be enabled (after
        # EMERGE_DEFAULT_OPTS has been parsed).
        portage.output.havecolor = 0
-
-       # optimize --help (no need to load config / EMERGE_DEFAULT_OPTS)
-       if "--help" in args or "-h" in args:
-               emerge_help()
-               return 0
-
        portage._disable_legacy_globals()
        portage.dep._internal_warnings = True
 
@@ -984,6 +978,11 @@ def emerge_main(args=None):
        if "--accept-properties" in myopts:
                os.environ["ACCEPT_PROPERTIES"] = myopts["--accept-properties"]
 
+       # optimize --help (no need to load config / EMERGE_DEFAULT_OPTS)
+       if myaction == "help":
+               emerge_help()
+               return os.EX_OK
+
        # Portage needs to ensure a sane umask for the files it creates.
        os.umask(0o22)
        if myaction == "sync":