xpak-helper.py: portage.util._argparse
authorZac Medico <zmedico@gentoo.org>
Sat, 3 Aug 2013 01:32:21 +0000 (18:32 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 3 Aug 2013 01:32:21 +0000 (18:32 -0700)
bin/xpak-helper.py

index 7a3865c10c0fa259ad7f80589a23877e17101f14..d9d325d59e22a96863aa4f27f2ba051338669b08 100755 (executable)
@@ -2,11 +2,11 @@
 # Copyright 2009-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-import optparse
 import sys
 import portage
 portage._internal_caller = True
 from portage import os
+from portage.util._argparse import ArgumentParser
 
 def command_recompose(args):
 
@@ -46,8 +46,8 @@ def main(argv):
        usage = "usage: %s COMMAND [args]" % \
                os.path.basename(argv[0])
 
-       parser = optparse.OptionParser(description=description, usage=usage)
-       options, args = parser.parse_args(argv[1:])
+       parser = ArgumentParser(description=description, usage=usage)
+       options, args = parser.parse_known_args(argv[1:])
 
        if not args:
                parser.error("missing command argument")