Closed
Conversation
Many options which required an argument were declared as taking an optional argument. The option handling loop, however, did not expect optional arguments. For example, passing "--qual-threshold 30" rather than "--qual-threshold=30" or "-q 30" led to a segfault when atoi() was passed NULL (optarg). There were other affected options as well. This commit correctly declares the required/optional/none status of option arguments and matches that short-form option spec. Presumably this was confusion between the entire option being optional and the option's argument being optional. The required option checking is done outside of getopt.
This will help keep them in sync when updating options.
The usage docs now indicate option arguments and are easier to read. If the usage was specifically requested with --help, then it is printed to stdout instead of stderr. This is useful for the common idiom of asking for help and piping to a pager like less or more (without redirecting stderr).
Silences warnings about //-style comments and long strings. Since kseq.h uses inline functions, a feature of C99, it's not useful pretending to be C89 compat (GCC's default).
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See commit messages for description.