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

using *args with @call_parse #487

Open
deven367 opened this issue Sep 10, 2022 · 1 comment · May be fixed by #564
Open

using *args with @call_parse #487

deven367 opened this issue Sep 10, 2022 · 1 comment · May be fixed by #564

Comments

@deven367
Copy link

I am trying to the use the call_parse decorator with *args and I can't seem to figure how to make it work. Here is the function definition,

@call_parse
def timesheet(*args):
  pass

When I call the function in the nb, there's no problem,

timesheet(2, 'OH', 3, 'CSDP', 3, 'OR')

however, while calling the functions from the terminal becomes a problem

(base) devengqc@17-CN0065CL-1:~/git/projects/personal$ timesheet --args "2, 'OH', 3, 'CSDP', 3, 'OR'"
usage: timesheet [-h] args
timesheet: error: argument args: invalid _empty value: "2, 'OH', 3, 'CSDP', 3, 'OR'"

I've tried other combinations as well in the terminal and they don't seem to work. Is there a way around this? Or am I doing something wrong?

@jph00
Copy link
Member

jph00 commented Sep 11, 2022

That's not a feature of call_parse at the moment. A PR would be welcome if you'd like to add support for list params.

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