don't even init ncurses if help flag is present
1 files changed, 7 insertions(+), 8 deletions(-)

M src/main.rs
M src/main.rs +7 -8
@@ 29,8 29,6 @@ fn main() {
         std::process::exit(code);
     };
 
-    init_ncurses();
-
     const ARG_HELP: &'static str = "help";
     const ARG_ROWS: &'static str = "rows";
     const ARG_COLS: &'static str = "cols";

          
@@ 64,24 62,25 @@ fn main() {
     let matches = match options.parse(&args[1..]) {
         Ok(m) => m,
         Err(e) => {
-            end_ncurses();
             print_help(false);
             exit_with_msg(1, &e.to_string());
             unreachable!()
         }
     };
 
+    if matches.opt_present(ARG_HELP) {
+        print_help(false);
+        std::process::exit(0);
+    }
+
+    init_ncurses();
+
     let mut maxy = 0;
     let mut maxx = 0;
     getmaxyx(stdscr, &mut maxy, &mut maxx);
     let maxy = maxy;
     let maxx = maxx;
 
-    if matches.opt_present(ARG_HELP) {
-        end_ncurses();
-        print_help(false);
-        std::process::exit(0);
-    }
     let rows = if matches.opt_present(ARG_ROWS) {
         matches.opt_str(ARG_ROWS).unwrap().parse::<usize>().unwrap_or_else(|_| {
             end_ncurses();