Repository navigation
Replies: 1 comment
|
Thanks for the clear proposal. This is implemented in #1689, following your design: cmd "shell" help="Open a shell in the worktree" {
env "SHELL" help="The program to open" default_note="bash"
}
It accepts AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5; version: unavailable. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
What I want to declare
A CLI whose commands read environment variables that are not a flag's value: one command reads
SHELLto pick the program it opens, a few commands read a tool's home (TOOL_HOME) to findfiles that tool writes. Today the spec can say:
flag "--x <v>" env="X"/arg … env="X": a variable bound to a flag or an argument;config { prop "k" scope="env" { env "X" } }: a setting of the whole program.Neither fits a variable that only one command reads and that has no flag: binding it to an
invented flag adds a surface nobody asked for, and a root
configprop documents it for everycommand, including the ones that never read it.
Proposal
An
envnode inside acmd(and at the root, for symmetry), carrying the same attributes as aprop's documentation:usage g markdownlists it under the command, like its flags;unknown_env;usage lintchecks it like a flag'senv.Why
A command's page is where a reader learns everything that changes its behaviour; an environment
variable that only lives in prose (
after_long_help) is invisible to generated docs, to JSONoutput and to
unknown_env.All reactions