Is there a standardized syntax for Linux prognam?

On a Linux system, typing is typical progname --helpto see the help output for this program. After that, you will see a description of the type:progname [SWITCHES] [FILES]... [ETC]

My question is: is there a standardized syntax for its appearance (using the command line)?

To describe things like extra keys, a few options (like a list of files), switch patterns, etc. There seems to be a standard so that anyone who knows it can accurately interpret your documentation.

Note. This is purely writing my documentation, not an analysis of the arguments.

+3
source share
4 answers

I have looked at many linux man pages, and here are a few things I have seen that seem to be standard for the manual pages that come standard with Linux. Like some of the above authors, there is no published documentation standard. I saw some differences on the Internet, but the pages that come with Linux look pretty consistent.

  • The corresponding command will appear first.
  • Things that are parameters provided by the user are placed in angle brackets "<>" with the name specified inside the brackets that describes the parameter. ex.
  • Parameters that are optional are enclosed in square brackets, "[]".
  • , , "|", "".
  • dot dot dot "...", , . . [...].
  • . , . "filename" "file_name", " ".

, . , .

+2

GNU Getopt, , . , , .

+1

​​ ? Linux:

getopt - use in script http://linuxmanpages.com/man1/getopt.1.php

getopt, getopt_long - use in C + / C ++ http://linuxmanpages.com/man3/getopt.3.php

+1
source

Source: https://habr.com/ru/post/1753332/


All Articles