change-git-user 1.2.0

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

pub fn main<'a>(users: Users, matches: &ArgMatches<'a>) -> Result<()> {
    let selection = matches.value_of("name").unwrap();

    let selection = users
        .get(selection)
        .context("Couldn't find a git config set matching provided name")?;

    change_config(&selection)
}