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?

asked Oct 27, 2022 at 18:14

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.

answered Oct 27, 2022 at 18:18
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) Commented Jun 29, 2023 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.

answered Oct 28, 2022 at 7:07

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.