# Distributed under the terms of the GNU General Public License v2
import io
-import optparse
import os
import sys
import textwrap
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])
"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),))