2

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 2

7

In the Python world, by far the most common is "do what argparse does". The reasons for this are hopefully obvious.

1
  • This will get a new projected started very fast on the right foot: import typer, def main(... with type annotations, then finally typer.run(main)
    – J_H
    Jun 29 at 20:31
2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.