ssadler / hawk

Awk for Hoodlums
BSD 3-Clause "New" or "Revised" License
35 stars 2 forks source link

errors on --help #20

Closed gelisam closed 11 years ago

gelisam commented 11 years ago

We do show the usage when the user types hawk --help, but that's only because --help is an invalid option:

> hawk --help
Missing argument representing the function to evaluate:
         opts: Options {optDelimiter = Nothing, optRecompile = False, optMap = False, optEval = False, optHelp = True, optIgnoreErrors = True, optModuleFile = Nothing}
        args: []

Usage: hawk [<options>] <cmd> [<file>]
  -d[<String>]  --delimiter[=<String>]  String used as delimiter
  -r            --recompile             Recompile toolkit.hs
  -m            --map                   Map a command over each string separated by the delimiter
  -e            --eval                  Ignore stdin and the input file and evaluate the user expression
  -h            --help                  Print help and exit
  -E            --errors                When set, errors in user code block execution. When is not set, errors don't block the execution and are logged to stderr. Default: False
melrief commented 11 years ago

My fault, but it should be easy to fix by forcing the option module to ignore errors when the user set the help flag.