aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/git-sugpatch.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/git-sugpatch.rs')
-rw-r--r--src/bin/git-sugpatch.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/bin/git-sugpatch.rs b/src/bin/git-sugpatch.rs
index 0ad8874..2a9b348 100644
--- a/src/bin/git-sugpatch.rs
+++ b/src/bin/git-sugpatch.rs
@@ -2,11 +2,14 @@ use std::env;
use std::process;
use github_suggestion::{Client, SuggestionUrl};
+use github_suggestion_cli::config::Config;
fn main() {
let args: Vec<_> = env::args().collect();
+ let config = Config::get(&args).unwrap();
+
if args.len() < 2 {
process::exit(111);
}
@@ -14,9 +17,9 @@ fn main() {
let url: SuggestionUrl = args[1].parse().unwrap();
let client = Client::new(
- env!("GITHUB_TOKEN"),
- &url.owner,
- &url.repo,
+ &config.github_token,
+ &config.owner,
+ &config.repo,
).unwrap();
let suggestion = client.fetch(&url.comment_id).unwrap();