Struct broot::verb::Verb[][src]

pub struct Verb {
    pub names: Vec<String>,
    pub keys: Vec<KeyEvent>,
    pub keys_desc: String,
    pub invocation_parser: Option<InvocationParser>,
    pub execution: VerbExecution,
    pub description: VerbDescription,
    pub selection_condition: SelectionType,
    pub needs_selection: bool,
    pub needs_another_panel: bool,
    pub auto_exec: bool,
    pub show_in_doc: bool,
}
Expand description

what makes a verb.

Verbs are the engines of broot commands, and apply

  • to the selected file (if user-defined, then must contain {file}, {parent} or {directory})
  • to the current app state There are two types of verbs executions:
  • external programs or commands (cd, mkdir, user defined commands, etc.)
  • internal behaviors (focusing a path, going back, showing the help, etc.) Some verbs are builtins, some other ones are created by configuration. Both builtins and configured vers can be internal or external based.

Fields

names: Vec<String>

names (like “cd”, “focus”, “focus_tab”, “c”) by which a verb can be called. Can be empty if the verb is only called with a key shortcut. Right now there’s no way for it to contain more than 2 elements but this may change.

keys: Vec<KeyEvent>

key shortcuts

keys_desc: String

description of the optional keyboard key(s) triggering that verb

invocation_parser: Option<InvocationParser>

how the input must be checked and interpreted Can be empty if the verb is only called with a key shortcut.

execution: VerbExecution

how the verb will be executed

description: VerbDescription

a description

selection_condition: SelectionType

the type of selection this verb applies to

needs_selection: bool

whether the verb needs a selection

needs_another_panel: bool

whether we need to have a secondary panel for execution (which is the case when the execution pattern has {other-panel-file})

auto_exec: bool

if true (default) verbs are directly executed when triggered with a keyboard shortcut

show_in_doc: bool

whether to show the verb in help screen (if we show all input related actions, the doc is unusable)

Implementations

Assuming the verb has been matched, check whether the arguments are OK according to the regex. Return none when there’s no problem and return the error to display if arguments don’t match.

in case the verb take only one argument of type path, return the selection type of this unique argument

Trait Implementations

Formats the value using the given formatter. Read more

read a deserialized verb conf item into a verb, checking a few basic things in the process

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.