Code

RelNotes: the first batch of topics graduated to 'master'
[git.git] / parse-options.c
index 890684166520659106703420fe80be147c7ad75d..850cfa78c9b7bbcd1cb8504453f60fd15b8ceebb 100644 (file)
@@ -393,6 +393,8 @@ int parse_options_step(struct parse_opt_ctx_t *ctx,
                        case -1:
                                return parse_options_usage(ctx, usagestr, options, 1);
                        case -2:
+                               if (ctx->opt)
+                                       check_typos(arg + 1, options);
                                goto unknown;
                        }
                        if (ctx->opt)
@@ -533,7 +535,7 @@ static int usage_with_options_internal(struct parse_opt_ctx_t *ctx,
                        continue;
 
                pos = fprintf(outfile, "    ");
-               if (opts->short_name && !(opts->flags & PARSE_OPT_NEGHELP)) {
+               if (opts->short_name) {
                        if (opts->flags & PARSE_OPT_NODASH)
                                pos += fprintf(outfile, "%c", opts->short_name);
                        else
@@ -542,9 +544,7 @@ static int usage_with_options_internal(struct parse_opt_ctx_t *ctx,
                if (opts->long_name && opts->short_name)
                        pos += fprintf(outfile, ", ");
                if (opts->long_name)
-                       pos += fprintf(outfile, "--%s%s",
-                               (opts->flags & PARSE_OPT_NEGHELP) ?  "no-" : "",
-                               opts->long_name);
+                       pos += fprintf(outfile, "--%s", opts->long_name);
                if (opts->type == OPTION_NUMBER)
                        pos += fprintf(outfile, "-NUM");