From: Zac Medico Date: Sat, 3 Aug 2013 00:48:25 +0000 (-0700) Subject: binhost-snapshot: portage.util._argparse X-Git-Tag: v2.2.0_alpha192~8 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3e12410b8c7a6ea5416f24a6e15cd377917ab775;p=portage.git binhost-snapshot: portage.util._argparse --- diff --git a/bin/binhost-snapshot b/bin/binhost-snapshot index e9bd45a2f..376080c05 100755 --- a/bin/binhost-snapshot +++ b/bin/binhost-snapshot @@ -3,7 +3,6 @@ # Distributed under the terms of the GNU General Public License v2 import io -import optparse import os import sys import textwrap @@ -18,6 +17,7 @@ pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym") sys.path.insert(0, pym_path) import portage portage._internal_caller = True +from portage.util._argparse import ArgumentParser def parse_args(argv): prog_name = os.path.basename(argv[0]) @@ -45,11 +45,12 @@ def parse_args(argv): "write Packages index with\n" + \ " snapshot_uri" - parser = optparse.OptionParser(usage=usage) - parser.add_option('--hardlinks', help='create hardlinks (y or n, default is y)', - choices=('y', 'n')) - parser.set_defaults(hardlinks='y') - options, args = parser.parse_args(argv[1:]) + parser = ArgumentParser(usage=usage) + parser.add_argument('--hardlinks', + help='create hardlinks (y or n, default is y)', + choices=('y', 'n'), + default='y') + options, args = parser.parse_known_args(argv[1:]) if len(args) != 4: parser.error("Required 4 arguments, got %d" % (len(args),))