Skip to main content

invoked_command

Function invoked_command 

Source
pub(crate) fn invoked_command() -> Option<String>
Expand description

The command word this invocation was reaching for, if any.

Reads the process arguments again rather than being handed them: usage is called from a dozen places, most of them deep inside a command’s own flag parsing where the name has long since been destructured away, and threading it through all of them would be a dozen chances to pass the wrong one.