2022-06-14 06:12:03 +08:00
|
|
|
<!--
|
2023-01-02 20:51:48 +08:00
|
|
|
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
2022-06-14 06:12:03 +08:00
|
|
|
|
|
|
|
SPDX-License-Identifier: curl
|
|
|
|
-->
|
|
|
|
|
2016-11-14 06:40:12 +08:00
|
|
|
# curl man page generator
|
|
|
|
|
2024-03-12 17:34:58 +08:00
|
|
|
`managen` is the curl man page generator. It generates a single nroff man page
|
2016-11-14 06:40:12 +08:00
|
|
|
output from the set of sources files in this directory.
|
|
|
|
|
docs/cmdline: change to .md for cmdline docs
- switch all invidual files documenting command line options into .md,
as the documentation is now markdown-looking.
- made the parser treat 4-space indents as quotes
- switch to building the curl.1 manpage using the "mainpage.idx" file,
which lists the files to include to generate it, instead of using the
previous page-footer/headers. Also, those files are now also .md
ones, using the same format. I gave them underscore prefixes to make
them sort separately:
_NAME.md, _SYNOPSIS.md, _DESCRIPTION.md, _URL.md, _GLOBBING.md,
_VARIABLES.md, _OUTPUT.md, _PROTOCOLS.md, _PROGRESS.md, _VERSION.md,
_OPTIONS.md, _FILES.md, _ENVIRONMENT.md, _PROXYPREFIX.md,
_EXITCODES.md, _BUGS.md, _AUTHORS.md, _WWW.md, _SEEALSO.md
- updated test cases accordingly
Closes #12751
2024-01-21 06:18:43 +08:00
|
|
|
The `mainpage.idx` file lists all files that are rendered in that order to
|
|
|
|
produce the output. The magic `%options` keyword inserts all command line
|
|
|
|
options documented.
|
|
|
|
|
|
|
|
The `%options` documentation is created with one source file for each
|
|
|
|
supported command line option.
|
|
|
|
|
|
|
|
The documentation file format is described below. It is meant to look similar
|
|
|
|
to markdown which is why it uses `.md` file extensions.
|
2016-11-14 06:40:12 +08:00
|
|
|
|
|
|
|
## Option files
|
|
|
|
|
|
|
|
Each command line option is described in a file named `<long name>.d`, where
|
2024-02-27 17:35:28 +08:00
|
|
|
option name is written without any prefixing dashes. Like the filename for the
|
|
|
|
`-v, --verbose` option is named `verbose.d`.
|
docs/cmdline: change to .md for cmdline docs
- switch all invidual files documenting command line options into .md,
as the documentation is now markdown-looking.
- made the parser treat 4-space indents as quotes
- switch to building the curl.1 manpage using the "mainpage.idx" file,
which lists the files to include to generate it, instead of using the
previous page-footer/headers. Also, those files are now also .md
ones, using the same format. I gave them underscore prefixes to make
them sort separately:
_NAME.md, _SYNOPSIS.md, _DESCRIPTION.md, _URL.md, _GLOBBING.md,
_VARIABLES.md, _OUTPUT.md, _PROTOCOLS.md, _PROGRESS.md, _VERSION.md,
_OPTIONS.md, _FILES.md, _ENVIRONMENT.md, _PROXYPREFIX.md,
_EXITCODES.md, _BUGS.md, _AUTHORS.md, _WWW.md, _SEEALSO.md
- updated test cases accordingly
Closes #12751
2024-01-21 06:18:43 +08:00
|
|
|
|
|
|
|
Each file has a set of meta-data in the top of the file, followed by a body of
|
|
|
|
text.
|
2016-11-14 06:40:12 +08:00
|
|
|
|
docs/cmdline: change to .md for cmdline docs
- switch all invidual files documenting command line options into .md,
as the documentation is now markdown-looking.
- made the parser treat 4-space indents as quotes
- switch to building the curl.1 manpage using the "mainpage.idx" file,
which lists the files to include to generate it, instead of using the
previous page-footer/headers. Also, those files are now also .md
ones, using the same format. I gave them underscore prefixes to make
them sort separately:
_NAME.md, _SYNOPSIS.md, _DESCRIPTION.md, _URL.md, _GLOBBING.md,
_VARIABLES.md, _OUTPUT.md, _PROTOCOLS.md, _PROGRESS.md, _VERSION.md,
_OPTIONS.md, _FILES.md, _ENVIRONMENT.md, _PROXYPREFIX.md,
_EXITCODES.md, _BUGS.md, _AUTHORS.md, _WWW.md, _SEEALSO.md
- updated test cases accordingly
Closes #12751
2024-01-21 06:18:43 +08:00
|
|
|
The documentation files that do not document options have no meta-data part.
|
|
|
|
|
|
|
|
A line that starts with `<!--` is a comment. It should also end with `-->`.
|
2016-11-14 06:40:12 +08:00
|
|
|
|
|
|
|
### Meta-data
|
|
|
|
|
docs/cmdline: change to .md for cmdline docs
- switch all invidual files documenting command line options into .md,
as the documentation is now markdown-looking.
- made the parser treat 4-space indents as quotes
- switch to building the curl.1 manpage using the "mainpage.idx" file,
which lists the files to include to generate it, instead of using the
previous page-footer/headers. Also, those files are now also .md
ones, using the same format. I gave them underscore prefixes to make
them sort separately:
_NAME.md, _SYNOPSIS.md, _DESCRIPTION.md, _URL.md, _GLOBBING.md,
_VARIABLES.md, _OUTPUT.md, _PROTOCOLS.md, _PROGRESS.md, _VERSION.md,
_OPTIONS.md, _FILES.md, _ENVIRONMENT.md, _PROXYPREFIX.md,
_EXITCODES.md, _BUGS.md, _AUTHORS.md, _WWW.md, _SEEALSO.md
- updated test cases accordingly
Closes #12751
2024-01-21 06:18:43 +08:00
|
|
|
--- (start of meta-data)
|
2022-10-18 16:39:43 +08:00
|
|
|
Added: (version number in which this was added)
|
2016-11-14 06:40:12 +08:00
|
|
|
Arg: (the argument the option takes)
|
2022-10-18 16:39:43 +08:00
|
|
|
c: (copyright line)
|
docs/cmdline: change to .md for cmdline docs
- switch all invidual files documenting command line options into .md,
as the documentation is now markdown-looking.
- made the parser treat 4-space indents as quotes
- switch to building the curl.1 manpage using the "mainpage.idx" file,
which lists the files to include to generate it, instead of using the
previous page-footer/headers. Also, those files are now also .md
ones, using the same format. I gave them underscore prefixes to make
them sort separately:
_NAME.md, _SYNOPSIS.md, _DESCRIPTION.md, _URL.md, _GLOBBING.md,
_VARIABLES.md, _OUTPUT.md, _PROTOCOLS.md, _PROGRESS.md, _VERSION.md,
_OPTIONS.md, _FILES.md, _ENVIRONMENT.md, _PROXYPREFIX.md,
_EXITCODES.md, _BUGS.md, _AUTHORS.md, _WWW.md, _SEEALSO.md
- updated test cases accordingly
Closes #12751
2024-01-21 06:18:43 +08:00
|
|
|
Example:
|
|
|
|
- (an example command line, without "curl" and can use `$URL`)
|
|
|
|
- (another example)
|
2022-10-18 16:39:43 +08:00
|
|
|
Experimental: yes (if so)
|
|
|
|
Help: (short text for the --help output for this option)
|
|
|
|
Long: (long form name, without dashes)
|
2016-11-14 06:40:12 +08:00
|
|
|
Magic: (description of "magic" options)
|
2024-06-28 04:54:28 +08:00
|
|
|
Multi: single/append/boolean/mutex/custom/per-URL (if used more than once)
|
2017-03-08 16:20:36 +08:00
|
|
|
Mutexed: (space separated list of options this overrides, no dashes)
|
2022-10-18 16:39:43 +08:00
|
|
|
Protocols: (space separated list for which protocols this option works)
|
2017-03-08 16:20:36 +08:00
|
|
|
Requires: (space separated list of features this requires, no dashes)
|
2023-02-21 23:42:26 +08:00
|
|
|
Scope: global (if the option is global)
|
docs/cmdline: change to .md for cmdline docs
- switch all invidual files documenting command line options into .md,
as the documentation is now markdown-looking.
- made the parser treat 4-space indents as quotes
- switch to building the curl.1 manpage using the "mainpage.idx" file,
which lists the files to include to generate it, instead of using the
previous page-footer/headers. Also, those files are now also .md
ones, using the same format. I gave them underscore prefixes to make
them sort separately:
_NAME.md, _SYNOPSIS.md, _DESCRIPTION.md, _URL.md, _GLOBBING.md,
_VARIABLES.md, _OUTPUT.md, _PROTOCOLS.md, _PROGRESS.md, _VERSION.md,
_OPTIONS.md, _FILES.md, _ENVIRONMENT.md, _PROXYPREFIX.md,
_EXITCODES.md, _BUGS.md, _AUTHORS.md, _WWW.md, _SEEALSO.md
- updated test cases accordingly
Closes #12751
2024-01-21 06:18:43 +08:00
|
|
|
See-also:
|
|
|
|
- (a related option, no dashes)
|
|
|
|
- (another related option, no dashes)
|
2022-10-18 16:39:43 +08:00
|
|
|
Short: (single letter, without dash)
|
2022-06-14 06:12:03 +08:00
|
|
|
SPDX-License-Identifier: curl
|
2022-10-18 16:39:43 +08:00
|
|
|
Tags: (space separated list)
|
2016-11-14 06:40:12 +08:00
|
|
|
--- (end of meta-data)
|
|
|
|
|
|
|
|
### Body
|
|
|
|
|
|
|
|
The body of the description. Only refer to options with their long form option
|
2023-09-08 20:32:29 +08:00
|
|
|
version, like `--verbose`. The output generator replaces such option with the
|
2016-11-14 06:40:12 +08:00
|
|
|
correct markup that shows both short and long version.
|
|
|
|
|
2023-09-08 20:32:29 +08:00
|
|
|
Text written within `*asterisks*` is shown using italics. Text within two
|
|
|
|
`**asterisks**` is shown using bold.
|
2016-11-14 06:40:12 +08:00
|
|
|
|
2023-09-08 20:32:29 +08:00
|
|
|
Text that is prefixed with a space is treated like an "example" and gets
|
|
|
|
output in monospace.
|
2021-11-15 21:47:46 +08:00
|
|
|
|
docs/cmdline: change to .md for cmdline docs
- switch all invidual files documenting command line options into .md,
as the documentation is now markdown-looking.
- made the parser treat 4-space indents as quotes
- switch to building the curl.1 manpage using the "mainpage.idx" file,
which lists the files to include to generate it, instead of using the
previous page-footer/headers. Also, those files are now also .md
ones, using the same format. I gave them underscore prefixes to make
them sort separately:
_NAME.md, _SYNOPSIS.md, _DESCRIPTION.md, _URL.md, _GLOBBING.md,
_VARIABLES.md, _OUTPUT.md, _PROTOCOLS.md, _PROGRESS.md, _VERSION.md,
_OPTIONS.md, _FILES.md, _ENVIRONMENT.md, _PROXYPREFIX.md,
_EXITCODES.md, _BUGS.md, _AUTHORS.md, _WWW.md, _SEEALSO.md
- updated test cases accordingly
Closes #12751
2024-01-21 06:18:43 +08:00
|
|
|
Within the body, describe a list of items like this:
|
2024-01-09 17:20:48 +08:00
|
|
|
|
|
|
|
## item 1
|
|
|
|
description
|
|
|
|
|
|
|
|
## item 2
|
|
|
|
second description
|
|
|
|
|
|
|
|
The list is automatically terminated at end of file, or you can do it
|
|
|
|
explicitly with an empty "header":
|
|
|
|
|
|
|
|
##
|
|
|
|
|
2024-02-07 01:07:07 +08:00
|
|
|
Angle brackets (`<>`) need to be escaped when used in text like `\<` and
|
|
|
|
`\>`. This, to ensure that the text renders nicely as markdown.
|
|
|
|
|
docs/cmdline: change to .md for cmdline docs
- switch all invidual files documenting command line options into .md,
as the documentation is now markdown-looking.
- made the parser treat 4-space indents as quotes
- switch to building the curl.1 manpage using the "mainpage.idx" file,
which lists the files to include to generate it, instead of using the
previous page-footer/headers. Also, those files are now also .md
ones, using the same format. I gave them underscore prefixes to make
them sort separately:
_NAME.md, _SYNOPSIS.md, _DESCRIPTION.md, _URL.md, _GLOBBING.md,
_VARIABLES.md, _OUTPUT.md, _PROTOCOLS.md, _PROGRESS.md, _VERSION.md,
_OPTIONS.md, _FILES.md, _ENVIRONMENT.md, _PROXYPREFIX.md,
_EXITCODES.md, _BUGS.md, _AUTHORS.md, _WWW.md, _SEEALSO.md
- updated test cases accordingly
Closes #12751
2024-01-21 06:18:43 +08:00
|
|
|
### Headers
|
|
|
|
|
2024-03-01 03:55:28 +08:00
|
|
|
The `#` header can be used by non-option files and it produces a
|
docs/cmdline: change to .md for cmdline docs
- switch all invidual files documenting command line options into .md,
as the documentation is now markdown-looking.
- made the parser treat 4-space indents as quotes
- switch to building the curl.1 manpage using the "mainpage.idx" file,
which lists the files to include to generate it, instead of using the
previous page-footer/headers. Also, those files are now also .md
ones, using the same format. I gave them underscore prefixes to make
them sort separately:
_NAME.md, _SYNOPSIS.md, _DESCRIPTION.md, _URL.md, _GLOBBING.md,
_VARIABLES.md, _OUTPUT.md, _PROTOCOLS.md, _PROGRESS.md, _VERSION.md,
_OPTIONS.md, _FILES.md, _ENVIRONMENT.md, _PROXYPREFIX.md,
_EXITCODES.md, _BUGS.md, _AUTHORS.md, _WWW.md, _SEEALSO.md
- updated test cases accordingly
Closes #12751
2024-01-21 06:18:43 +08:00
|
|
|
`.SH` output.
|
|
|
|
|
|
|
|
If the `#` header is used for a command line option file, that header is
|
|
|
|
simply ignored in the generated output. It can still serve a purpose in the
|
|
|
|
source file as it helps the user identify what option the file is for.
|
2021-03-22 23:50:57 +08:00
|
|
|
|
docs/cmdline: change to .md for cmdline docs
- switch all invidual files documenting command line options into .md,
as the documentation is now markdown-looking.
- made the parser treat 4-space indents as quotes
- switch to building the curl.1 manpage using the "mainpage.idx" file,
which lists the files to include to generate it, instead of using the
previous page-footer/headers. Also, those files are now also .md
ones, using the same format. I gave them underscore prefixes to make
them sort separately:
_NAME.md, _SYNOPSIS.md, _DESCRIPTION.md, _URL.md, _GLOBBING.md,
_VARIABLES.md, _OUTPUT.md, _PROTOCOLS.md, _PROGRESS.md, _VERSION.md,
_OPTIONS.md, _FILES.md, _ENVIRONMENT.md, _PROXYPREFIX.md,
_EXITCODES.md, _BUGS.md, _AUTHORS.md, _WWW.md, _SEEALSO.md
- updated test cases accordingly
Closes #12751
2024-01-21 06:18:43 +08:00
|
|
|
### Variables
|
2021-03-22 23:50:57 +08:00
|
|
|
|
docs/cmdline: change to .md for cmdline docs
- switch all invidual files documenting command line options into .md,
as the documentation is now markdown-looking.
- made the parser treat 4-space indents as quotes
- switch to building the curl.1 manpage using the "mainpage.idx" file,
which lists the files to include to generate it, instead of using the
previous page-footer/headers. Also, those files are now also .md
ones, using the same format. I gave them underscore prefixes to make
them sort separately:
_NAME.md, _SYNOPSIS.md, _DESCRIPTION.md, _URL.md, _GLOBBING.md,
_VARIABLES.md, _OUTPUT.md, _PROTOCOLS.md, _PROGRESS.md, _VERSION.md,
_OPTIONS.md, _FILES.md, _ENVIRONMENT.md, _PROXYPREFIX.md,
_EXITCODES.md, _BUGS.md, _AUTHORS.md, _WWW.md, _SEEALSO.md
- updated test cases accordingly
Closes #12751
2024-01-21 06:18:43 +08:00
|
|
|
There are three different "variables" that can be used when creating the
|
|
|
|
output. They need to be written within backticks in the source file (to escape
|
|
|
|
getting spellchecked by CI jobs): `%DATE`, `%VERSION` and `%GLOBALS`.
|
2016-11-14 06:40:12 +08:00
|
|
|
|
|
|
|
## Generate
|
|
|
|
|
2024-03-08 18:22:12 +08:00
|
|
|
`managen mainpage [list of markdown option file names]`
|
2016-11-14 06:40:12 +08:00
|
|
|
|
2016-11-15 16:08:50 +08:00
|
|
|
This command outputs a single huge nroff file, meant to become `curl.1`. The
|
|
|
|
full curl man page.
|
|
|
|
|
2024-03-08 18:22:12 +08:00
|
|
|
`managen ascii [list of markdown option file names]`
|
|
|
|
|
|
|
|
This command outputs a single text file, meant to become `curl.txt`. The full
|
|
|
|
curl man page in text format, used to build `tool_hugehelp.c`.
|
|
|
|
|
|
|
|
`managen listhelp`
|
2016-11-15 16:08:50 +08:00
|
|
|
|
|
|
|
Generates a full `curl --help` output for all known command line options.
|