If true
, the type of args
passed to
{@link CCliArgGroupOptions.parse} does not include undefined
.
A text description of this argument group. Paragraphs are re-wrapped when printed to the terminal so don't worry about whitespace.
If true
, command-line usage won't show this arg group unless it's
invoked directly
Unless true
, a CCliUsageError thrown if no argument is provided
for this argument group
A short placeholder for this argument group in command-line usage. By
convention, @carnesen/cli placeholders are wrapped in angled brackets
e.g. "<email>"
Methods for decorating command output with colors
Color the text blue
Color the text bold
Color the text red
Color the text red
Type of the input
argument injected into injected into
{@link CCliCommandOptions.action}
Options for {@link CliCommandGroup}
A short description for command-line usage
If true
, hide these commands in command-line usage
Name of this command group
The {@link ICliCommandGroup]]s and/or [[
ICliCommand}s in this group
Options for creating a @carnesen/cli command
Function or async function that implements the command
A sentence or two about this command for command-line usage or a function returning the description text
A CCliArgGroup for the arguments after a lone "--"
If true
, don't show this command in command-line usage
Identifier for this command in command-line usage
A CCliArgGroup for the arguments passed as "--name value"
A CCliArgGroup for the arguments before the first separator argument
Type of a command description when it's a function
Options for CCliFlagArgGroup
Options for CCliJsonArgGroup
Data structure representing a leaf node in a command tree
Options for CCliNumberArgGroup
Options for CCliNumberArrayArgGroup a.k.a ccli.numberArray
Options for creating a CCli
Enable/disable ANSI text color decoration
Text coloring methods. Takes precedence over the ansi
option if
provided. If not provided, a CCliColor instance will be created
using cCliColorFactory with the {@link CCliOptions.ansi} option
Number of terminal columns
Called after the command has completed. Defaults to process.exit
CliLogger
object to use for the CLI. Defaults to the global console
object. The CLI runner calls logger.log
on the command's action
return
value if there is one. The CLI runner calls logger.error
on the
exception if one is thrown. The logger
is injected into the command
action
too.
Defines the type of the args passed to an CCliArgGroup.parse
An isomorphic subset of the Node.js global process
object. By defining our
own type for this we avoid depending on @types/node
package
Root of a command tree
Options for {@link CliStringArgGroup}
Options for {@link CliStringArgGroup}
Options for a CCliStringChoiceArgGroup
Type of the "choices" option
Type of {@link CCliCommandGroupOptions.subcommands}
Data structure representing a node in a command tree
FOR INTERNAL USE ONLY. The result of calling {@link navigateCommandTree}
Passed args past those used during navigation
An error message describing why navigation stopped
The point in the command tree at which navigation stopped
Type of the object injected into a command's description when it's a function
Color the text blue
Color the text bold
Color the text red
Color the text red
A factory for CCliProcess objects that are a type- and
environment-safe alternative to the Node.js global process
Get a reference to the global variable process
if it exists. The return
value is type-asserted as any
so be careful with it.
FOR INTERNAL USE ONLY. Walk a tree of commands to find the one selected by the arguments provided
A command tree root
An array of command-line arguments
The result of the search
Generate a string text description from a description string or function
Options for creating an argument group, a group of adjacent command-line arguments