click
click copied to clipboard
Opinion: Arguments should not be required for Variadics
Docs:
- Arguments: If you come from argparse, you might be missing support for setting nargs to + to indicate that at least one argument is required. This is supported by setting required=True. However, this should not be used if you can avoid it as we believe scripts should gracefully degrade into becoming noops if a variadic argument is empty. The reason for this is that very often, scripts are invoked with wildcard inputs from the command line and they should not error out if the wildcard is empty.
Reasoning: Beyond the reasoning stated, I don't know of any.
Feature unlocked: N/A
I don't think this one is a problem. As it says, the feature is already supported (nargs=-1, required=True). Stating why that might be a bad idea if you're trying to design a CLI tool that behaves well in pipelines seems fine to me.