added some command line stuff
This commit is contained in:
parent
de1846e904
commit
c878f5c963
18
src/arg.rs
18
src/arg.rs
@ -38,6 +38,24 @@ pub fn get_args() -> ArgMatches<'static> {
|
|||||||
.value_names(&["OWNER", "REPO"])
|
.value_names(&["OWNER", "REPO"])
|
||||||
.help("Fork a repository for a user")
|
.help("Fork a repository for a user")
|
||||||
)
|
)
|
||||||
|
.arg(Arg::with_name("draw")
|
||||||
|
.short("o")
|
||||||
|
.long("push")
|
||||||
|
.value_names(&["OWNER", "REPO", "BRANCH"])
|
||||||
|
.help("Push local changes to a remote repository")
|
||||||
|
)
|
||||||
|
.arg(Arg::with_name("pull")
|
||||||
|
.short("pl")
|
||||||
|
.long("pull")
|
||||||
|
.value_names(&["OWNER", "REPO", "BRANCH"])
|
||||||
|
.help("Pull latest changes from a remote repository")
|
||||||
|
)
|
||||||
|
.arg(Arg::with_name("clone")
|
||||||
|
.short("i")
|
||||||
|
.long("clone")
|
||||||
|
.value_names(&["OWNER", "REPO"])
|
||||||
|
.help("Clone a repository")
|
||||||
|
)
|
||||||
)
|
)
|
||||||
.subcommand(SubCommand::with_name("issue")
|
.subcommand(SubCommand::with_name("issue")
|
||||||
.about("Create, search, comment, close, or reopen an issue")
|
.about("Create, search, comment, close, or reopen an issue")
|
||||||
|
12
src/main.rs
12
src/main.rs
@ -45,6 +45,18 @@ fn main() {
|
|||||||
if repo_matches.is_present("list") {
|
if repo_matches.is_present("list") {
|
||||||
repo.list_repo(&request)
|
repo.list_repo(&request)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if repo_matches.is_present("push") {
|
||||||
|
repo.push_to_remote(&request)
|
||||||
|
}
|
||||||
|
|
||||||
|
if repo_matches.is_present("pull") {
|
||||||
|
repo.pull_from_remote(&request)
|
||||||
|
}
|
||||||
|
|
||||||
|
if repo_matches.is_present("clone") {
|
||||||
|
repo.clone_from_remote(&request, &config)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
("issue", Some(issue_matches)) => {
|
("issue", Some(issue_matches)) => {
|
||||||
let issue = issue::Issue::new();
|
let issue = issue::Issue::new();
|
||||||
|
Loading…
Reference in New Issue
Block a user