From 6051edc63666eab2862482fcb496a307e95ca760 Mon Sep 17 00:00:00 2001 From: derrod Date: Mon, 1 Jun 2020 08:12:24 +0200 Subject: [PATCH] [cli] Show warning for incorrect -y/--yes usage --- legendary/cli.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/legendary/cli.py b/legendary/cli.py index 763e95e..bf36d0d 100644 --- a/legendary/cli.py +++ b/legendary/cli.py @@ -1111,6 +1111,11 @@ 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 '-y' in extra or '--yes' in extra: + logger.warning('-y/--yes flag needs to be specified *before* the command name') + # technically args.func() with setdefaults could work (see docs on subparsers) # but that would require all funcs to accept args and extra... try: