diff --git a/docs/specification.md b/docs/specification.md index e558f89..0efa9b7 100644 --- a/docs/specification.md +++ b/docs/specification.md @@ -11,20 +11,12 @@ Set the description for the command. # @describe A demo CLI ``` -```sh -# @describe Multi-line auto-wrapped help text -# -# Extra lines after the @cmd or @describe, which don't start with an @, are -# treated as the long description. A line which is not a comment ends -# the block. -``` - ## `@cmd` Define a subcommand. > **Syntax**\ -> `@cmd` description? +> `@cmd` [_description_]? ```sh # @cmd Upload a file @@ -75,7 +67,7 @@ Define a positional argument. > **Syntax**\ > `@arg` arg-name [_modifier_]?[_param-value_]? > [_notation_]? -> description? +> [_description_]? ```sh # @arg va @@ -103,7 +95,7 @@ Define an option argument. > **Syntax**\ > `@option` [_short_]? [_long_] [_modifier_]?[_param-value_]? > [_notations_]? -> description? +> [_description_]? ```sh # @option --oa @@ -134,7 +126,7 @@ Define a flag argument. Flag is a special option that does not accept any value. > **Syntax**\ > `@flag` [_short_]?[_long_] `*`? -> description? +> [_description_]? ```sh # @flag --fa @@ -150,7 +142,7 @@ Define an environment variable. > **Syntax**\ > `@arg` env-name [_modifier_]?[_param-value_]? > [_notation_]? -> description? +> [_description_]? ```sh # @env EA optional @@ -183,15 +175,15 @@ Add a metadata. ```sh # @meta version 1.0.0 # @meta author nobody -# @meta dotenv # Load .env -# @meta dotenv .env.local # Load .env.local +# @meta dotenv +# @meta dotenv .env.local # @meta symbol +toolchain[`_choice_fn`] -# @meta man-section 8 # Generate to man section 8 +# @meta man-section 8 ``` ## Deprecated tags -Deprecated tags can still be used, but are not recommended and may be completely abandoned in subsequent versions. +Deprecated tags can still be used, but are not recommended and may be completely abandoned in the next major version (v2). ### `@version` @@ -234,14 +226,12 @@ The long version of the flag / option. > **Syntax**\ >   `!` \ -> | `*` \ -> | `+` \ -> | `*` [_separated-char_] \ -> | `+` [_separated-char_] +> | `*` [_separated-char_]? \ +> | `+` [_separated-char_]? - `!`: required -- `*`: multi-occurs (for @option); multi-values (for @arg) -- `+`: required + multi-occurs (for @option); required + multi-values (for @arg) +- `*`: multi-occurs for @option; multi-values for @arg; +- `+`: required + multiple - [_separated-char_]: *char*-separated list ### param-value @@ -301,6 +291,18 @@ A-Z a-z 0-9 `!` `#` `$` `%` `*` `+` `,` `.` `/` `:` `=` `?` `@` `[` `]` `^` `_` `,` `:` `@` `|` `/` +## description + +Plain text, can be multiple lines. + +```sh +# @describe Multi-line auto-wrapped help text +# +# Extra lines after the @describe/@cmd/@option/@flag/@arg/@env, +# which don't start with an @, are treated as the long description. +# A line which is not a comment ends the block. +``` + [_short_]: #short [_long_]: #long [_modifier_]: #modifier @@ -312,4 +314,5 @@ A-Z a-z 0-9 `!` `#` `$` `%` `*` `+` `,` `.` `/` `:` `=` `?` `@` `[` `]` `^` `_` [_notation-modifier_]: #notation-modifier [_short-char_]: #short-char [_separated-char_]: #separated-char -[_long-name_]: #long-name \ No newline at end of file +[_long-name_]: #long-name +[_description_]: #description \ No newline at end of file