Łukasz Langa avatar Łukasz Langa committed c7118e8

fixed: two-level argparse broke support for -h

Comments (0)

Files changed (2)

 
 setup (
     name = 'rename',
-    version = '1.0c1',
+    version = '1.0c2',
     author = 'Lukasz Langa',
     author_email = 'support@langacore.org, lukasz@langa.pl',
     description = "Renames files using regular expressions",
                                                 'references to groups in the '
                                                 'regular expression')
 
-    stparser = argparse.ArgumentParser(prog='rename')
+    stparser = argparse.ArgumentParser(prog='rename', add_help=False)
     stparser.add_argument('--selftest', action='store_true',
                         help='run internal unit tests')
-    args = stparser.parse_args()
-    if not args.selftest:
+    args = stparser.parse_known_args()
+    if not args[0].selftest:
         args = parser.parse_args()
         args.regex = "".join(args.regex)
         args.except_regex = "".join(args.except_regex)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.