I have a program with a lot of potential arguments. This basically allows the user get/set/delete/listany table in a very small database. Each column has an argument that can be passed. This is not the main interface, but just a useful admin interface.
In any case, if the user wants to insert a row into the table, he must know the name of all the columns. Although it’s easy to see that using it is also a pain in the butt.
So, I changed the code so that the user can pass the --prompt option, and the program will offer them for each column name associated with the table specified by it. But my problem is that now I need to duplicate my input restrictions (selection, types, etc.) In two places - argparse and this hint.
- Question # 1: is there a better way to do this?
- Question # 2: Is there a clean way to refer to containment restrictions for this purpose?
- Question # 3: are there any libraries as alternatives that combine command line arguments, options, and tooltips?
thank
source
share