diff --git a/legendary/cli.py b/legendary/cli.py index 4093b1f..da98c8a 100644 --- a/legendary/cli.py +++ b/legendary/cli.py @@ -1294,10 +1294,10 @@ def main(): logging.getLogger('requests').setLevel(logging.WARNING) logging.getLogger('urllib3').setLevel(logging.WARNING) - # -y having to be specified before the subcommand is a little counter-intuitive - # For now show a warning if a user is misusing that flag + # if --yes is used as part of the subparsers arguments manually set the flag in the main parser. if '-y' in extra or '--yes' in extra: - logger.warning('-y/--yes flag needs to be specified *before* the command name') + args.yes = True + extra = [i for i in extra if i not in ('--yes', '-y')] # technically args.func() with setdefaults could work (see docs on subparsers) # but that would require all funcs to accept args and extra...