configcmd and version: the config and version standard commands; darwin /var/run
core/configcmd: "<program> config create|validate|upgrade|path" from a Spec (name, application, minimal/full templates, Validate, Schema), taken over from yamase-core/pkg/configcmd and generalized: Filename, Optional (programs that run on defaults) and None (no configuration). core/version: "<program> version [--json]" over the values each program stamps into its internal/version; JSON keys match yasta's existing output (yavebu reads it), VCS fallback for unstamped builds. paths: macOS CLI/Service system-scope RuntimeDir is /var/run/<app> instead of /run/<app>, which macOS does not have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ca0f06f978
commit
90132e2d76
13 files changed
+1824
-20
No files matched your search
@@ -234,3 +234,19 @@ test file). This is spec section 47's explicit requirement, and it's
|
||||
why `Explain` and `Ensure*` are entirely separate code paths: the former
|
||||
must never accidentally gain a side effect by sharing implementation
|
||||
with the latter.
|
||||
|
||||
## Standard commands: one implementation, program-specific data
|
||||
|
||||
`manual`, `completion`, `doctor`, `configcmd` and `version` implement
|
||||
the commands every Yetano program offers (docs/program-conventions.md in
|
||||
the meta-repository). Each takes the program's own part as plain data
|
||||
(an embedded FS, a command tree, a report, a `configcmd.Spec`, a
|
||||
`version.Info`) and returns an exit code; none depends on cobra or on a
|
||||
program's flag parser, so a flag-only daemon and a cobra CLI wire them
|
||||
the same way. They never mutate the filesystem except where the command
|
||||
exists to do so (`config create`, `config upgrade --write`).
|
||||
|
||||
`configcmd` keeps the config schema in the program: core only knows the
|
||||
YAML tree, the templates and, via reflection on the program's struct,
|
||||
which keys exist. It started as `yamase-core/pkg/configcmd` and moved
|
||||
here unchanged in behavior when the other meta-repos needed it.
|
||||
Reference in new issue
Block a user