Skip to content

When only using command decorator for closures, parameter parsing is strange #1210

Discussion options

You must be logged in to vote

That seems expected behaviour, and isn't anything to do with being in a closure. Rather, its because when you've only one command, typer doesn't create a group - it just invokes the single command. So main.py foo isn't selecting the foo command, it's directly invoking the only defined command with argument "foo". When you add a second command (your lambda), it then creates a group, and so then "foo" is selecting the command.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by typed-sigterm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem
2 participants