Merge pull request #134 from rleungx/report-parse-errors-to-stderr
report parse errors to stderr
This commit is contained in:
commit
43e6741071
|
@ -12,6 +12,7 @@ use solana::transaction::Transaction;
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::io::stdin;
|
use std::io::stdin;
|
||||||
use std::net::UdpSocket;
|
use std::net::UdpSocket;
|
||||||
|
use std::process::exit;
|
||||||
use std::thread::sleep;
|
use std::thread::sleep;
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
|
|
||||||
|
@ -27,7 +28,10 @@ fn main() {
|
||||||
let args: Vec<String> = env::args().collect();
|
let args: Vec<String> = env::args().collect();
|
||||||
let matches = match opts.parse(&args[1..]) {
|
let matches = match opts.parse(&args[1..]) {
|
||||||
Ok(m) => m,
|
Ok(m) => m,
|
||||||
Err(f) => panic!(f.to_string()),
|
Err(e) => {
|
||||||
|
eprintln!("{}", e);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if matches.opt_present("s") {
|
if matches.opt_present("s") {
|
||||||
|
|
|
@ -11,6 +11,7 @@ use solana::event::Event;
|
||||||
use solana::historian::Historian;
|
use solana::historian::Historian;
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::io::{self, stdout, BufRead};
|
use std::io::{self, stdout, BufRead};
|
||||||
|
use std::process::exit;
|
||||||
use std::sync::atomic::AtomicBool;
|
use std::sync::atomic::AtomicBool;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
|
|
||||||
|
@ -22,7 +23,10 @@ fn main() {
|
||||||
let args: Vec<String> = env::args().collect();
|
let args: Vec<String> = env::args().collect();
|
||||||
let matches = match opts.parse(&args[1..]) {
|
let matches = match opts.parse(&args[1..]) {
|
||||||
Ok(m) => m,
|
Ok(m) => m,
|
||||||
Err(f) => panic!(f.to_string()),
|
Err(e) => {
|
||||||
|
eprintln!("{}", e);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
if matches.opt_present("p") {
|
if matches.opt_present("p") {
|
||||||
port = matches.opt_str("p").unwrap().parse().expect("port");
|
port = matches.opt_str("p").unwrap().parse().expect("port");
|
||||||
|
|
Loading…
Reference in New Issue