Also because the word usage appears in my text file, it says "usage: usage" When I call the main function with no subcommands and no arguments, my help_text from the text file outputs, and then like 2-3 additional lines of boiler plate I can't seem to get rid of. Lastly, I have set up a base case to display the help text whenever no subcommands are given. Before I reworked the help text, I had help text for each individual subcommand by using "help=" but now those are all blank. Only one of those subparsers has any additional arguments (one positional, one optional). Then I create subparsers (4 of them and then a base case) to create subcommands. I read in my help text file, set it to a string help_text, and then set "usage=help_text" on the parser. Here is the basics of how my program is broken down: But my boss isn't satisfied with the default help text, so he is having me write up the full usage/help text in a text file and just display the entire file.įor some reason, in a certain case, its outputting the text twice. Originally I had tried to leverage argparse's built in help text behavior. I created a command line interface with argparse. Default is stdout (print on your screen) Īfter an hour googling, I can't find anybody who has had anything resembling this issue besides myself. o output_filename Output filename to write data. to= Date as end of period for data retrieval. from= Date as beginning of period for data retrieval.'Worker Name' or 'Worker Name 1, Worker Name 2' workers= Workers as coma seprated list. projects= Projects names as coma separated list.How_much_hours Shows how much work hours are registered according to given parameters. Totra how_much_hours -from= Īctivities Output activities in -format.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |