Skip to content

Commit

Permalink
fix scripts failing with no processing mode set
Browse files Browse the repository at this point in the history
fixes #499
  • Loading branch information
Sebastian Böck committed Jan 21, 2022
1 parent 419efca commit d4a1b0e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions bin/BarTracker
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def main():
# signal processor
signal_processor = SignalProcessor(**vars(args))
# beats processor
load_beats_processor = None
if hasattr(args, 'infile'):
# single mode: read the beats from STDIN
load_beats_processor = LoadBeatsProcessor(**vars(args))
Expand Down
5 changes: 5 additions & 0 deletions bin/evaluate
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ def main():
# parse the args
args = p.parse_args()

# print usage if no evaluation mode was set
if not getattr(args, 'eval', False):
p.print_usage()
exit(0)

# print the arguments
if args.verbose >= 2:
print(args)
Expand Down
8 changes: 8 additions & 0 deletions madmom/processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,14 @@ def io_arguments(parser, output_suffix='.txt', pickle=True, online=False):
# add general options
parser.add_argument('-v', dest='verbose', action='count',
help='increase verbosity level')

# print usage if no processing mode is set
def print_usage(*args, **kwargs):
parser.print_usage()
exit(0)

parser.set_defaults(func=print_usage)

# add subparsers
sub_parsers = parser.add_subparsers(title='processing options')

Expand Down

0 comments on commit d4a1b0e

Please sign in to comment.