Module builtins

Source
Expand description

Infrastructure for shell built-in commands.

Structs§

BuiltinResult
Result of executing a built-in command.
Registration
Encapsulates a registration for a built-in command.

Enums§

ContentType
Type of help content, typically associated with a built-in command.
ExitCode
Exit codes for built-in commands.

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.
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
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::builtins::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.