History

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

Paul Brossier committed 9 years ago

Commit 2615dd91 parent 62a94b71 file · +7 −6Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/lib/aubio/cmd.py+7−6
@@ -19,8 +19,8 @@ def aubio_parser(): · 18 unmodified lines
19 parser.add_argument('-V', '--version', help="show version",19 parser.add_argument('-V', '--version', help="show version",
20 action="store_true", dest="show_version")20 action="store_true", dest="show_version")
21 21
22 subparsers = parser.add_subparsers(dest='command',22 subparsers = parser.add_subparsers(title='commands', dest='command',
23 description="", metavar="<command>")23 metavar="")
24 24
25 # onset subcommand25 # onset subcommand
26 subparser = subparsers.add_parser('onset',26 subparser = subparsers.add_parser('onset',
@@ -354,12 +354,13 @@ class process_melbands(default_process): · 327 unmodified lines
354def main():354def main():
355 parser = aubio_parser()355 parser = aubio_parser()
356 args = parser.parse_args()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 sys.stdout.write('aubio version ' + aubio.version + '\n')358 sys.stdout.write('aubio version ' + aubio.version + '\n')
359 if args.show_version and args.command is None:
360 sys.exit(0)359 sys.exit(0)
361 if args.command is None:360 elif 'verbose' in args and args.verbose > 3:
362 sys.stderr.write("Error: a command is required\n")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 parser.print_help()364 parser.print_help()
364 sys.exit(1)365 sys.exit(1)
365 elif not args.source_uri and not args.source_uri2:366 elif not args.source_uri and not args.source_uri2:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t