pub struct CommandSpec {
pub description: Option<String>,
pub run: Option<String>,
pub append: Option<String>,
pub path: Option<String>,
pub docker: Option<String>,
pub ddp: Option<DdpConfig>,
pub training: Option<TrainingConfig>,
pub output: Option<OutputConfig>,
pub options: BTreeMap<String, Value>,
pub cluster: Option<bool>,
pub load_error: Option<String>,
}Expand description
A command at any nesting level. Three mutually-exclusive kinds are recognised at resolve time:
- Path (
pathset, or by default when the map is empty/null): the command is a pointer to a childfdl.yml. By convention the path is./<command-name>/when omitted. - Run (
runset): the command is a self-contained shell script that is executed as-is. Optionaldocker:service routes it throughdocker compose. - Preset: neither
pathnorrunis set. The command merges itsddp/training/output/optionsfields over the enclosingCommandConfigdefaults and invokes that config’sentry:.
Fields§
§description: Option<String>§run: Option<String>Inline shell command. Mutex with path.
append: Option<String>Default trailing tokens for a run: command. Split on its own
first -- into pre/post halves; user args after fdl’s first
-- are split similarly, then everything merges as
[append-pre] [user-pre] -- [append-post] [user-post]. Append
seeds defaults; user args last-win on each side. The legacy
append: -- --nocapture shape (empty pre, libtest tokens post)
keeps working as a degenerate case. Drop entirely with the
global --no-append flag.
path: Option<String>Pointer to a child directory containing its own fdl.yml. Absolute
or relative to the declaring config’s directory. Mutex with run.
None + no other fields = “use the convention path
./<command-name>/”.
docker: Option<String>Docker compose service for run-kind commands.
ddp: Option<DdpConfig>Preset overrides. Only consulted when neither run nor path is set.
training: Option<TrainingConfig>§output: Option<OutputConfig>§options: BTreeMap<String, Value>§cluster: Option<bool>Dispatch this command across every host in
ProjectConfig::cluster’s hosts list. Set to true to opt the
command into multi-host execution. Default None means single-host
(today’s behavior). Has no effect when no cluster: block is
declared at the project root.
load_error: Option<String>Per-entry parse failure, captured instead of failing the whole
commands: map. Unknown keys (deny_unknown_fields) and type
errors inside ONE command’s block must not block --help or
sibling commands — validation stays scoped to the single thing
invoked. Surfaced through Self::kind, which every dispatch
path consults, so the error fires exactly when this command is
used.
Implementations§
Source§impl CommandSpec
impl CommandSpec
Sourcepub fn kind(&self) -> Result<CommandKind, String>
pub fn kind(&self) -> Result<CommandKind, String>
Classify this command. Returns an error when both run and path
are declared — always a mistake, caught loudly rather than silently
picking one. Also rejects docker: without run:: the docker
service wraps the inline run-script, so pairing it with a path:
pointer or a preset entry is always silent-noop territory.
Sourcepub fn resolve_path(&self, name: &str, parent_dir: &Path) -> PathBuf
pub fn resolve_path(&self, name: &str, parent_dir: &Path) -> PathBuf
Resolve the effective directory for a Path-kind command declared
in parent_dir. Applies the ./<name>/ convention when path is
unset.
Trait Implementations§
Source§impl Clone for CommandSpec
impl Clone for CommandSpec
Source§fn clone(&self) -> CommandSpec
fn clone(&self) -> CommandSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more