Showing the changes to python (1 of 1 file). Show all
Unified · Split
| @@ -19,8 +19,8 @@ def aubio_parser(): · 18 unmodified lines | ||
| 19 | 19 | parser.add_argument('-V', '--version', help="show version", |
| 20 | 20 | action="store_true", dest="show_version") |
| 21 | 21 | |
| 22 | − subparsers = parser.add_subparsers(dest='command', | |
| 23 | − description="", metavar="<command>") | |
| 22 | + subparsers = parser.add_subparsers(title='commands', dest='command', | |
| 23 | + metavar="") | |
| 24 | 24 | |
| 25 | 25 | # onset subcommand |
| 26 | 26 | subparser = subparsers.add_parser('onset', |
| @@ -354,12 +354,13 @@ class process_melbands(default_process): · 327 unmodified lines | ||
| 354 | 354 | def main(): |
| 355 | 355 | parser = aubio_parser() |
| 356 | 356 | args = parser.parse_args() |
| 357 | − if args.show_version or ('verbose' in args and args.verbose > 3): | |
| 357 | + if 'show_version' in args and args.show_version: | |
| 358 | 358 | sys.stdout.write('aubio version ' + aubio.version + '\n') |
| 359 | − if args.show_version and args.command is None: | |
| 360 | 359 | sys.exit(0) |
| 361 | − if args.command is None: | |
| 362 | − sys.stderr.write("Error: a command is required\n") | |
| 360 | + elif 'verbose' in args and args.verbose > 3: | |
| 361 | + sys.stderr.write('aubio version ' + aubio.version + '\n') | |
| 362 | + if 'command' not in args or args.command is None: | |
| 363 | + # no command given, print help and return 1 | |
| 363 | 364 | parser.print_help() |
| 364 | 365 | sys.exit(1) |
| 365 | 366 | elif not args.source_uri and not args.source_uri2: |