2 ms·
Those are all great points. I do like the idea of a stand-alone file. Especially since then you could do code generation and if you care about doing type hints
by IgorPartola 2y ago
Those are all great points. I do like the idea of a stand-alone file. Especially since then you could do code generation and if you care about doing type hints you now could.
groper uses getopt built into the Python standard library as well as the ini file parser. This way there are no dependencies on external stuff. And it automatically generates help text with all the options and can automatically generate a sample config file with all the default options hard coded in the code. Those two things have made it invaluable for me when I used it extensively. I think adding environment variables to the mix would be a good idea.
I am not sure what you mean by --options. By @files do you mean like what curl can do? If so I have always solved that by just doing something like --in or --file or just making the input file the last argument to the command.
Lists are definitely tricky but if I recall correctly the version I put on GitHub allows you to specify the same option multiple times in order to get a list but I’m not sure that’s the cleanest way to do this. Possibly having custom option types that do splitting on a delimiter for something like port numbers could be good.
In either case it’s good to know that this space still could use some work because that’ll be the motivation for me to dust off this project.