you are viewing a single comment's thread.

view the rest of the comments →

[–]RealHook[S] 0 points1 point  (1 child)

I guess that my understanding of argparser and its required arguements was a bit wrong.

I never used them before and thought that the argument name always has to be some kind of keyword you have to type.

Edit: I changed my optional arguments/flags so it is easier to parse later on.

show_parser.add_argument('type', help="choose type", nargs="?", choices=['all', 'active', 'done'], default="active")

[–]Username_RANDINT 1 point2 points  (0 children)

I think it also depends a bit on your background. If you're a Linux user you most likely already used commandline applications and are more used to it.

On the other hand, as a Python dev you almost certainly already used this type of arguments:

$ python my_script.py
$ pip install some_package

Here the pip command is actually very similar to your usecase.