delph-in / repp

Regular Expression Preprocessor

Home Page:https://github.com/delph-in/docs/wiki/ReppTop

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unrecognized command options cause a crash

goodmami opened this issue · comments

Calling the compiled repp command with an unknown option leads to a hard crash:

$ ./repp -h
terminate called after throwing an instance of 'boost::wrapexcept<boost::program_options::unknown_option>'
  what():  unrecognised option '-h'
zsh: IOT instruction (core dumped)  src/repp -h

It would be more useful if unrecognized options just show the usage. And apparently the help option is --help or -? (and -? needs to be quoted in some shells, like ZSH):

$ ./repp --help
Usage: src/repp [options] [input-file]
Options:
  -? [ --help ]         This usage information.
  -c [ --config ] arg   Configuration file (REQUIRED).
  --format arg          Token format: string, line, offsets, triple (default 
                        string).
  -r [ --rpp ] arg      Specify non-default location of directory containing 
                        repp modules. (Default locations are relative to the 
                        config file. See README.)