Crate oberst

Source

Modules§

parser

Macros§

define_command
Define a command with the given name and context type. Commands are defined as functions that take a reference to their context type as their first argument. The function should return a Result with an i32 as the success value or (). By default, a command’s usage is generated from its arguments in sequential order. To specify a custom usage string, add an args attribute to the function. The attribute should be a string literal containing the desired usage string excluding the command name.
register_command
Helper macro to register a command to a CommandSource.

Structs§

CommandDispatch
Helper struct generated by define_command!
CommandSource
The core of oberst. This struct manages commands and allows them to be dispatched.
CommandUsage
Contains the name and possible usages of a command. Generated automatically.

Enums§

CommandError
Any error that can occur while parsing or executing a command.

Type Aliases§

CommandResult
The result of a command execution.
Execute
Helper type used internally by define_command!.
Parse
Helper type used internally by define_command!.