Skip to content

Commit

Permalink
r657: check -p (lh3#96)
Browse files Browse the repository at this point in the history
Well, in principle, every option should be checked. Will do when someone raise
issues...
  • Loading branch information
lh3 committed Jan 19, 2018
1 parent 0454e6b commit 2b71181
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "mmpriv.h"
#include "getopt.h"

#define MM_VERSION "2.7-r655-dirty"
#define MM_VERSION "2.7-r657-dirty"

#ifdef __linux__
#include <sys/resource.h>
Expand Down
5 changes: 5 additions & 0 deletions map.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ int mm_set_opt(const char *preset, mm_idxopt_t *io, mm_mapopt_t *mo)

int mm_check_opt(const mm_idxopt_t *io, const mm_mapopt_t *mo)
{
if (mo->pri_ratio < 0.0f || mo->pri_ratio > 1.0f) {
if (mm_verbose >= 1)
fprintf(stderr, "[ERROR]\033[1;31m -p must be within 0 and 1 (including 0 and 1)\033[0m\n");
return -4;
}
if ((mo->flag & MM_F_FOR_ONLY) && (mo->flag & MM_F_REV_ONLY)) {
if (mm_verbose >= 1)
fprintf(stderr, "[ERROR]\033[1;31m --for-only and --rev-only can't be applied at the same time\033[0m\n");
Expand Down

0 comments on commit 2b71181

Please sign in to comment.