aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/main.rs b/src/main.rs
index 6b9d79e..75e74ac 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,6 +1,3 @@
-extern crate getopts;
-
-use getopts::Options;
use std::env;
use std::error::{self, Error};
use std::io::{self, BufRead, BufReader, Write};
@@ -168,15 +165,9 @@ fn print_usage(program: &str) {
fn main() {
let args: Vec<String> = env::args().collect();
let program = args[0].clone();
- let opts = Options::new();
-
- let opt_matches = match opts.parse(&args[1..]) {
- Ok(m) => m,
- Err(f) => panic!(f.to_string()),
- };
- let file = if !opt_matches.free.is_empty() {
- opt_matches.free[0].clone()
+ let file = if args.len() > 1 {
+ &args[1]
} else {
print_usage(&program);
return;