Skip to main content

flag_names

Function flag_names 

Source
fn flag_names(
    args: &[String],
    extra_args: &HashMap<String, Option<String>>,
) -> (String, usize)
Expand description

The recognised flag names in an argv, and a count of the -- tokens that are neither recognised nor a declared extra_args name.

Matching against LOGGABLE_FLAGS rather than on a -- prefix is what stops a value reaching the log when it happens to look like a flag - --mcp-config alone carries every external MCP server’s env and headers verbatim.

The count exists to make a silent omission loud, so it reads zero on every shape forge builds today. extra_args names are excluded because their own count reports them, which leaves this number meaning “a -- token nothing accounts for”. A repeated recognised flag also raises it - no production path emits one.