Use python click command with a class with variadic arguments
问题 I have a class that gets initialized with a previously unknown number of arguments and I want it to be done on cli using python click package. My issue is that I can't manage to initialize it and run a click command: $ python mycode.py arg1 arg2 ... argN click_command because with variadic arguments option nargs=-1 click don't recognize the click_command as a command. How can I input N args and then run a command using click? Setting a defined number of arguments, like nargs=5 , solves the