# HG changeset patch # User Teemu Piippo # Date 1399056131 -10800 # Node ID ed4289183de6cb765fd64f9478283c99918906fd # Parent c5858c0cd476b3825ca67eb38316dee390966426 - check for arg count before printing the header so the header doesn't appear when displaying usage diff -r c5858c0cd476 -r ed4289183de6 src/main.cpp --- a/src/main.cpp Fri May 02 21:38:19 2014 +0300 +++ b/src/main.cpp Fri May 02 21:42:11 2014 +0300 @@ -59,6 +59,13 @@ exit (0); } + if (argc < 2) + { + fprintf (stderr, "usage: %s [outfile] # compiles botscript\n", argv[0]); + fprintf (stderr, " %s -l # lists commands\n", argv[0]); + exit (1); + } + // Print header String header; String headerline; @@ -89,13 +96,6 @@ headerline += '-'; print ("%2\n\n%1\n\n%2\n\n", header, headerline); - if (argc < 2) - { - fprintf (stderr, "usage: %s [outfile] # compiles botscript\n", argv[0]); - fprintf (stderr, " %s -l # lists commands\n", argv[0]); - exit (1); - } - String outfile; if (argc < 3)