aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 7e971a7..183079a 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -44,6 +44,7 @@ fn main() {
let args: Vec<String> = env::args().collect();
let mut opts = Options::new();
+ opts.optopt("b", "browser", "set browser", "BROWSER");
opts.optflag("h", "help", "print this help menu");
let opt_matches = match opts.parse(&args[1..]) {
@@ -56,6 +57,13 @@ fn main() {
return
}
+ let browser = if opt_matches.opt_present("b") {
+ opt_matches.opt_str("b")
+ } else {
+ print_usage(opts);
+ return
+ };
+
open_stream().unwrap_or_else(|e| {
writeln!(io::stderr(), "{}", e)
.expect("Failed printing to stderr");