added some command line stuff

This commit is contained in:
Wyatt J. Miller 2021-12-19 20:01:05 -05:00
parent de1846e904
commit c878f5c963
2 changed files with 30 additions and 0 deletions

View File

@ -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")

View File

@ -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();