Module builtins

Module builtins 

Source
Expand description

Facilities for implementing and managing builtins

Structs§

Registration
Encapsulates a registration for a built-in command.

Enums§

ContentType
Type of help content, typically associated with a built-in command.

Traits§

Command
Trait implemented by built-in shell commands.
DeclarationCommand
Trait implemented by built-in shell commands that take specially handled declarations as arguments.
SimpleCommand
A simple command that can be registered as a built-in.

Functions§

builtin
Returns a built-in command registration, given an implementation of the Command trait.
decl_builtin
Returns a built-in command registration, given an implementation of the DeclarationCommand trait. Used for select commands that can take parsed declarations as arguments.
parse_known
This function and the try_parse_known exists to deal with the Clap’s limitation of treating -- like a regular value https://github.com/clap-rs/clap/issues/5055
raw_arg_builtin
Returns a built-in command registration, given an implementation of the DeclarationCommand trait that can be default-constructed. The command implementation is expected to implement clap’s Parser trait solely for help/usage information. Arguments are passed directly to the command via set_declarations. This is primarily only expected to be used with select builtin commands that wrap other builtins (e.g., “builtin”).
simple_builtin
Returns a built-in command registration, given an implementation of the SimpleCommand trait.
try_parse_known
Similar to parse_known but with clap::Parser::try_parse_from This function is used to parse arguments in builtins such as crate::echo::EchoCommand

Type Aliases§

CommandContentFunc
Type of a function to retrieve help content for a built-in command.
CommandExecuteFunc
Type of a function implementing a built-in command.