mourisl / Lighter

Fast and memory-efficient sequencing error corrector
GNU General Public License v3.0
92 stars 17 forks source link

Support CmdLine Basics #17

Closed proebuck closed 9 years ago

proebuck commented 9 years ago

Please add explicit cmdline options for both help and version information.

mourisl commented 9 years ago

Good suggestion! I've add two options "-h" and "-v" for help and version information. Thanks.

proebuck commented 9 years ago

Thanks for your prompt attention. Couple related mentions:

  1. on line 288, the condition should not check for help flag here, and code should EXIT_FAILURE (due to inadequate num of cmdline arguments).
  2. why not use getopt_long() instead?
  3. would suggest version number be put in variable near top of "main.cpp" rather than use hardcoded string (line 406); in its current location, very likely to not be updated (forgotten/missed) when other maintenance changes occur.
mourisl commented 9 years ago

Thanks for looking into the code and the suggestions.

  1. I do check the "-h" flag again in line 401. Now I've removed the checking on line 288 and changed all the exit code on exceptions to EXIT_FAILURE.
  2. I don't think getopt functions works well on the options with multiple arguments, such as "-k" and "-K" in our case. (Though it definitely can be resolved)
  3. I've created a string LIGHTER_VERSION near the top of main.cpp as you suggested.