Skip to content

Instantly share code, notes, and snippets.

@omad
Created November 16, 2023 01:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omad/17a481bff68de55a5ed332e1e3e155b6 to your computer and use it in GitHub Desktop.
Save omad/17a481bff68de55a5ed332e1e3e155b6 to your computer and use it in GitHub Desktop.
Experiments with Click arguments nargs
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