Skip to main content

Module prompt_source

Module prompt_source 

Source
Expand description

Resolve the two mutually-exclusive gw new / gw spawn prompt sources (--prompt, --prompt-file) into a single optional string.

Mutual exclusion is enforced at parse time by clap (ArgGroup in cli.rs), so this helper assumes at most one source is active.

--prompt - is the stdin form: when the inline value is exactly -, the prompt is read from stdin via the injected reader. This is the conventional Unix idiom (heredoc / pipe input) and replaces the older --prompt-stdin flag.

Constants§

STDIN_SENTINEL
Sentinel value that means “read prompt from stdin” when passed as the --prompt value.

Functions§

resolve_prompt
Collapse the two prompt sources (--prompt, --prompt-file) into a single optional string.