Skip to main content

program_of

Function program_of 

Source
pub fn program_of(key: &str) -> &str
Expand description

The program half of a key, dropping any folded subcommand or argument.

This is what makes a safe-command entry cover a family rather than a single invocation. A call to cat notes.md keys shell:cat notes.md, and an entry of cat keys shell:cat; without this they would never meet and naming a program as safe would do nothing for any call that passed it an argument.

The widening is one-directional and deliberate. It applies to entries a user wrote in their own config, where naming cat means every cat. A grant made at a prompt still matches exactly, so approving git diff never covers git push.