Use clap for git-add-coauthor
This commit is contained in:
parent
b0067e9115
commit
2009e9335a
|
|
@ -1,8 +1,8 @@
|
||||||
|
use clap::Parser;
|
||||||
use git_mob::{parse_coauthors_file, write_coauthors_file, Author};
|
use git_mob::{parse_coauthors_file, write_coauthors_file, Author};
|
||||||
use structopt::StructOpt;
|
|
||||||
|
|
||||||
#[derive(StructOpt, Debug)]
|
#[derive(Parser, Debug)]
|
||||||
#[structopt(name="git-add-coauthor")]
|
#[clap(name = "git-add-coauthor", version)]
|
||||||
/// Add a co-author to your git mob.
|
/// Add a co-author to your git mob.
|
||||||
struct Opt {
|
struct Opt {
|
||||||
/// Co-author initials
|
/// Co-author initials
|
||||||
|
|
@ -14,7 +14,7 @@ struct Opt {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let opt = Opt::from_args();
|
let opt = Opt::parse();
|
||||||
let mut authors = parse_coauthors_file().unwrap_or_default();
|
let mut authors = parse_coauthors_file().unwrap_or_default();
|
||||||
let new_author = Author {
|
let new_author = Author {
|
||||||
name: opt.name,
|
name: opt.name,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue