Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional parameters not working with CLI #729

Open
Alge opened this issue Feb 22, 2019 · 1 comment
Open

Optional parameters not working with CLI #729

Alge opened this issue Feb 22, 2019 · 1 comment

Comments

@Alge
Copy link

Alge commented Feb 22, 2019

@hug.get()
@hug.object.cli
def get_user(name: hug.types.text = "Alice"):
     return name

Running this and giving the positional argument python test.py get_user Bob doesn't forward the positional argument (always gives the default value "Alice")

@qutang
Copy link

qutang commented Sep 20, 2019

You should use -n or --name before your value.

python test.py get_user --name Bob

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants