plushie/cli_helpers
Shared helpers for CLI entry points.
Provides binary resolution and source path lookup used by gui, stdio, inspect, and other CLI modules.
Types
Error when the plushie binary cannot be resolved.
pub type ResolveError {
BinaryNotFound(binary.BinaryError)
ExplicitPathMissing(path: String)
}
Constructors
-
BinaryNotFound(binary.BinaryError)Binary not found at any searched location.
-
ExplicitPathMissing(path: String)An explicit path was given but the file does not exist.
Options controlling binary resolution.
pub type ResolveOpts {
ResolveOpts(binary_path: Result(String, Nil))
}
Constructors
-
ResolveOpts(binary_path: Result(String, Nil))Arguments
- binary_path
-
Explicit path to the binary. Overrides auto-resolution.
Values
pub fn default_resolve_opts() -> ResolveOpts
Default resolution options (auto-resolve).
pub fn resolve_binary(
opts: ResolveOpts,
) -> Result(String, ResolveError)
Resolve the plushie binary path.
If opts.binary_path is set, validates that the file exists.
Otherwise delegates to binary.find().
pub fn resolve_error_message(err: ResolveError) -> String
Format a ResolveError as a human-readable message.
pub fn source_path() -> Result(String, Nil)
Look up the plushie source checkout path from the PLUSHIE_SOURCE_PATH environment variable.