I have a python script that is supposed to be used as a small cli program. This is google's recommendations on how to document cli syntax. I was wondering, are there similar recommendations, or specifications, perhaps from GNU?
2 Answers
In the Python world, by far the most common is "do what argparse
does". The reasons for this are hopefully obvious.
-
This will get a new projected started very fast on the right foot: import typer,
def main(...
with type annotations, then finallytyper.run(main)
– J_HJun 29 at 20:31
There is a GNU Standard which is slightly more than to follow the POSIX Standard, which is used by a great number of programs and a good template to follow.
There is a style for Windows, but it is wretched so I'm not going to cite it, don't use it, stick to above.
In the specific case of python, follow the accepted answer.