Use clap for git-delete-coauthor
This commit is contained in:
parent
2a4bcd896e
commit
68e8e93bd0
|
|
@ -1,8 +1,8 @@
|
||||||
|
use clap::Parser;
|
||||||
use git_mob::{get_available_coauthors, write_coauthors_file};
|
use git_mob::{get_available_coauthors, write_coauthors_file};
|
||||||
use structopt::StructOpt;
|
|
||||||
|
|
||||||
#[derive(StructOpt, Debug)]
|
#[derive(Parser, Debug)]
|
||||||
#[structopt(name="git-delete-coauthor")]
|
#[clap(name = "git-delete-coauthor", version)]
|
||||||
/// Delete a co-author from your .git-coauthors file
|
/// Delete a co-author from your .git-coauthors file
|
||||||
struct Opt {
|
struct Opt {
|
||||||
/// Initials of the co-author to delete
|
/// Initials of the co-author to delete
|
||||||
|
|
@ -10,7 +10,7 @@ struct Opt {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let opt = Opt::from_args();
|
let opt = Opt::parse();
|
||||||
let mut authors = get_available_coauthors();
|
let mut authors = get_available_coauthors();
|
||||||
authors.remove(&opt.initials);
|
authors.remove(&opt.initials);
|
||||||
write_coauthors_file(authors);
|
write_coauthors_file(authors);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue