Skip to main content

add_key

Function add_key 

Source
pub fn add_key(
    path: &Path,
    person: &str,
    team: Option<&str>,
    default_project: Option<&str>,
    allow_multiple: bool,
) -> Result<String>
Expand description

Appends a [[keys]] entry. Preserves existing content (comments included) by appending; refuses a duplicate person unless allow_multiple.

Returns the plaintext key (print once, never store).

ยงErrors

Fails on unreadable/unparsable files, duplicate person, or write errors.