Expand description
Command Mode grammar: parsing, history, completion, and validation.
Handles the : and !-prefixed command grammar including :mkdir,
:touch, :rename, :mv, :cp, :git, :set, :term, and !<shell>.
§Grammar
command ::= ":" verb (" " arg)*
| "!" shell_string
verb ::= "mkdir" | "touch" | "rename" | "mv" | "cp" | "git" | "set"
| "sort" | "bookmark" | "jump" | "unmark" | "config" | "plugin"
| "term"Parsing only validates shape; what a command does is actions::mod’s
business. :git runs git through the configured shell, and :set goes
through TrailConfig::set_value.
Structs§
- Command
History - A ring buffer of past commands, persisted to a small cache file.
- Completion
Sources - What completion can offer beyond verbs and the filesystem: names that live in Trail’s own state rather than on disk.
- TabState
- Tracks the current tab-completion cycle.
Enums§
- Feed
Result - The result of feeding one keystroke to Command Mode.
- Parse
Error - Validation errors produced during command parsing.
- Parsed
Command - A successfully parsed, validated Command Mode input.
Functions§
- completions
- Returns a list of completion candidates for the current command
buffer. - completions_
with_ sources - Same as
completions, but with plugin action names and bookmarks to offer as well. - feed
- Feeds a single keystroke into Command Mode state.
- feed_
with_ sources - Same as
feed, but completion also offers plugin action names and bookmarks. - parse
- Parse
buffer(the text typed after:or!) into aParsedCommand.