Created
November 16, 2023 01:29
-
-
Save omad/17a481bff68de55a5ed332e1e3e155b6 to your computer and use it in GitHub Desktop.
Experiments with Click arguments nargs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import click | |
@click.command() | |
@click.argument("uri", type=str, nargs=-1) | |
@click.argument("product", nargs=1, required=False) | |
def cli(uri, product): | |
print(f"{repr(uri)}") | |
print(f"{repr(product)}") | |
if __name__ == "__main__": | |
cli() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment