Skip to main content

is_spec_request

Function is_spec_request 

Source
pub fn is_spec_request(root: &Command<'_>, argv: &[&OsStr]) -> bool
Expand description

Whether this argv asks for the spec rather than for the CLI to run.

Only the first word counts: mycli build __usage_spec__ passes the word through as an ordinary value, because a request is the whole invocation or it is nothing.

A root that declares a command of that name keeps it, which is the precedence the help subcommand already has. The check is here rather than in the derive because a Cli derive expands one struct and cannot see the variant names of a separate Subcommands enum — the static tables can.