We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 85e6967 commit 9267085Copy full SHA for 9267085
scraper/src/main.rs
@@ -24,6 +24,9 @@ enum Output {
24
Text,
25
}
26
27
+// Based on sysexits.h
28
+const USAGE: i32 = 64;
29
+
30
fn query<T: Read>(input: &Input, output: &Output, selector: &Selector, file: &mut T) -> bool {
31
let mut html = String::new();
32
file.read_to_string(&mut html).unwrap();
@@ -71,7 +74,10 @@ fn main() {
71
74
let args: Vec<String> = env::args().collect();
72
75
let matches = match opts.parse(&args[1..]) {
73
76
Ok(m) => m,
- Err(f) => panic!("{}", f.to_string()),
77
+ Err(f) => {
78
+ eprintln!("{}", f);
79
+ process::exit(USAGE);
80
+ }
81
};
82
if matches.opt_present("h") {
83
print!(
0 commit comments