Skip to main content

Crate fslite_command

Crate fslite_command 

Source
Expand description

A typed operation codec, constrained shell-like parser/renderer, and local/remote executors for driving any fslite_core::FileSystem backend from a command line.

Re-exports§

pub use help::VERB_HELP;
pub use help::VerbHelp;
pub use help::print_verb_help;
pub use help::print_verb_table;
pub use render::render_human;
pub use render::render_json;
pub use render::sanitize_for_terminal;
pub use render::sanitize_name;
pub use render::sanitize_preview;

Modules§

help
Per-verb documentation metadata for the fslite help command.
lexer
A deliberately tiny, hand-written tokenizer for fslite-command’s line grammar. It is not a shell: there is no expansion of any kind (globs, $VAR, ~, command substitution) and no shell metacharacter (|, ;, &, <, >, backtick, $() is ever treated as literal text when it appears unquoted — it is rejected outright, so a user who pastes a real shell command gets a clear error instead of a confusing partial parse.
parser
Verb table: turns tokenized input (Task 3’s crate::lexer) into a typed Command (Task 1). One arm per verb in the coverage table.
render
Turns a CommandOutput into text: either a human-readable summary (used by default in fslite-cli) or pretty-printed JSON matching the wire codec exactly (--json). Every untrusted string field (node names, link targets, and paths — which fslite-core normalizes but does not strip control bytes from) is passed through one of three sanitizers before it reaches a human-readable line, since a malicious filename or path segment is attacker-controlled input reaching a real terminal.

Structs§

LocalExecutor
Executes commands directly against an in-process FileSystem backend.
RemoteExecutor
Executes commands against a running fslite-server over HTTP.

Enums§

Command
One typed filesystem operation, serializable for local execution, remote transport, or storage as a batch --file script.
CommandOutput
The typed result of executing a crate::Command.

Traits§

Executor
Executes one typed Command against some backend, local or remote.