We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 381a4bd commit dc8a34fCopy full SHA for dc8a34f
scraper/src/main.rs
@@ -24,6 +24,9 @@ enum Output {
24
Text,
25
}
26
27
+// Based on sysexits.h
28
+pub const EX_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();
@@ -70,7 +73,10 @@ fn main() {
70
73
let args: Vec<String> = env::args().collect();
71
74
let matches = match opts.parse(&args[1..]) {
72
75
Ok(m) => m,
- Err(f) => panic!("{}", f.to_string()),
76
+ Err(f) => {
77
+ eprintln!("{}", f.to_string());
78
+ process::exit(EX_USAGE);
79
+ }
80
};
81
if matches.opt_present("h") {
82
print!(
0 commit comments