change-git-user 1.2.0

Manage multiple git configurations
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::{write_users, Users};
use anyhow::Result;
use clap::ArgMatches;
use std::path::Path;

pub fn main<'a, P: AsRef<Path>>(mut users: Users, matches: &ArgMatches<'a>, path: P) -> Result<()> {
    let selections = matches.values_of("names").unwrap();

    for key in selections {
        users.remove(key);
    }

    write_users(&users, path)
}