Changeset 2615dd9


Ignore:
Timestamp:
Mar 24, 2017, 3:20:11 AM (8 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, sampler
Children:
0561c54
Parents:
62a94b7
Message:

python/lib/aubio/cmd.py: improve help output

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/lib/aubio/cmd.py

    r62a94b7 r2615dd9  
    2020            action="store_true", dest="show_version")
    2121
    22     subparsers = parser.add_subparsers(dest='command',
    23             description="", metavar="<command>")
     22    subparsers = parser.add_subparsers(title='commands', dest='command',
     23            metavar="")
    2424
    2525    # onset subcommand
     
    355355    parser = aubio_parser()
    356356    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:
    358358        sys.stdout.write('aubio version ' + aubio.version + '\n')
    359     if args.show_version and args.command is None:
    360359        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
    363364        parser.print_help()
    364365        sys.exit(1)
Note: See TracChangeset for help on using the changeset viewer.