|
NAMEcli-generate - Generate source and documentation from CLI descriptionsSYNOPSIScli-generate [ -c | -h | -m | -w ] FILENAME.cliDESCRIPTIONOperationcli-generate reads in a CLI (command line interface) description file, parses it into its various sections, and prints out one of a set of output files. In typical usage, that output would be directed to a file and later compiled or included in other sources.The CLI file (named PROGRAM.cli) is divided into two parts, a header (formatted much like a standard mail header) and a series of sections. Headers and sections other than those specified below are ignored. All headers and sections are optional. File Formatfile = header "\n" *section header = *(header-line "\n") header-line = header-field ":" whitespace value whitespace = *(SPACE / TAB) section = "[" name "]" "\n" lines lines = *( line "\n" ) Headers
Section Names
Options Formatoptions = *(option / separator) option = option1 "\n" option2 "\n" *(line "\n") option1 = [shortopt] [longopt] type ["=" flag-value] variable ["=" init] option2 = helpstr ["=" default] separator = "-- " text "\n" shortopt = "-" character longopt = "--" word type = "FLAG" / "COUNTER" / "INTEGER" / "UINTEGER" / "STRING" / "STRINGLIST" / "FUNCTION" If not specified, flag-value and init are 0, and default is empty. FormattingExcept for [prefix], [options], and [suffix], all of the sections support formatting instructions similar to that of TeXinfo (but greatly simplified).
OPTIONS
EXAMPLESHere is a sample CLI file, containing many of the described elements.Min: 1 Max: 1 Usage: PATH Description: Create a file. Show-Pid: 0 Include: <stdio.h> [prefix] If the given PATH is a directory, it is suffixed with another name. [description] @program generates a new random file from a variety of sources including @command{ls} and @command{ps} output. If the given @option{PATH} is a directory, it is suffixed with another name of my choosing. [options] -v --verbose FLAG=1 opt_verbose -t --type STRING opt_type = "type1" The type of the file to generate. = type1 Possible types for this include @option{type1} and @option{base64}. AUTHORBruce Guenter <bruce@untroubled.org> Visit the GSP FreeBSD Man Page Interface. |