aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorBrian Harring <ferringb@gmail.com>2011-06-23 01:49:42 -0700
committerBrian Harring <ferringb@gmail.com>2011-08-06 01:05:58 -0700
commitb30505d391d772d0ad2b5ce0d4d564d04cda49af (patch)
tree1ca793779bee4c1d22fb593301a3457c9529b544 /bin
parentsplit out non optparse bits into main, leaving just the parser invocation (diff)
downloadpkgcore-b30505d391d772d0ad2b5ce0d4d564d04cda49af.tar.gz
pkgcore-b30505d391d772d0ad2b5ce0d4d564d04cda49af.tar.bz2
pkgcore-b30505d391d772d0ad2b5ce0d4d564d04cda49af.zip
enable argparse
Diffstat (limited to 'bin')
-rwxr-xr-xbin/pwrapper6
-rwxr-xr-xbin/pwrapper_installed6
2 files changed, 8 insertions, 4 deletions
diff --git a/bin/pwrapper b/bin/pwrapper
index 9139cfeb..60c60ffb 100755
--- a/bin/pwrapper
+++ b/bin/pwrapper
@@ -27,7 +27,9 @@ except ImportError:
if __name__ == '__main__':
name = osp.basename(sys.argv[0]).replace("-", "_")
script = modules.load_module('pkgcore.scripts.%s' % (name,))
- subcommands = getattr(script, 'commandline_commands', None)
+ subcommands = getattr(script, 'argparse_parser', None)
if subcommands is None:
- subcommands = {None: (script.OptionParser, script.main)}
+ subcommands = getattr(script, 'commandline_commands', None)
+ if subcommands is None:
+ subcommands = {None: (script.OptionParser, script.main)}
commandline.main(subcommands)
diff --git a/bin/pwrapper_installed b/bin/pwrapper_installed
index 2aea117d..4a1187b0 100755
--- a/bin/pwrapper_installed
+++ b/bin/pwrapper_installed
@@ -28,7 +28,9 @@ if __name__ == '__main__':
raise
sys.stderr.write('Add --debug to the commandline for a traceback.\n')
sys.exit(1)
- subcommands = getattr(script, 'commandline_commands', None)
+ subcommands = getattr(script, 'argparse_parser', None)
if subcommands is None:
- subcommands = {None: (script.OptionParser, script.main)}
+ subcommands = getattr(script, 'commandline_commands', None)
+ if subcommands is None:
+ subcommands = {None: (script.OptionParser, script.main)}
commandline.main(subcommands)