Исследования
На что смотрели, прежде чем действовать: вопрос, что нашли и на чём это стоит.
How have others let a declared command line take values that are known only when the program runs - and offer them as one types?
Two established shapes. clap's dynamic engine: the shell calls the program through the environment and the program answers; its weakness is that a value's function sees only the word being typed. usage (jdx): a declared spec with values either listed or built by running a command, and completions that call back at runtime - the same split we came to, declared or asked. Neither has what argenv is for: the declaration being the typed accessor itself, so it cannot drift from the code. Within the commons, checked the same day: argenv makes no completions; snapall and lab-agent each generate their own from their contract, and oco-agent types its usage text by hand - one nature, written three times. And argenv has no typed accessor for a list at all: no program of ours uses one.
2026-11-13
Другие источники
- clap_complete: the dynamic completion engine (CompleteEnv) - clap-rs, 2024 The shell calls the program itself, with COMPLETE=<shell> in the environment, and the program answers with candidates; functions attached to an argument give its values at runtime. A candidate function is handed only the word being typed: programs that need what was already said (a --root given earlier) parse the shell's line again by hand.
- usage: a spec for command lines, in KDL - jdx, 2026 One spec file gives shell completions, markdown docs and man pages; completions call back at runtime; an argument's allowed values may be built from a command that prints one value per line (choices run=); a line that does not parse prints no error over the prompt on Tab. A whole project of the same nature as argenv - arguments, flags, environment and config in one declaration.