fix: print help for list-deps when args not given

list-deps takes  positional args OR things like --providers

the issue with this, is that these args need to be optional since by nature, one or the other can be specified.

add a check to list-deps that checks if not args.providers and not args.config. If this is true, help is printed and we exit.

resolves #4075

Signed-off-by: Charlie Doern <cdoern@redhat.com>
This commit is contained in:
Charlie Doern 2025-11-05 11:28:43 -05:00
parent fd1603beef
commit afd19e25b5

View file

@ -46,6 +46,10 @@ class StackListDeps(Subcommand):
def _run_stack_list_deps_command(self, args: argparse.Namespace) -> None:
# always keep implementation completely silo-ed away from CLI so CLI
# can be fast to load and reduces dependencies
if not args.config and not args.providers:
self.parser.print_help()
self.parser.exit()
from ._list_deps import run_stack_list_deps_command
return run_stack_list_deps_command(args)