OSDN Git Service
(root)
/
git-core
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'maint' of git://github.com/git-l10n/git-po
[git-core/git.git]
/
parse-options.c
diff --git
a/parse-options.c
b/parse-options.c
index
0dd9fc6
..
fca7159
100644
(file)
--- a/
parse-options.c
+++ b/
parse-options.c
@@
-581,6
+581,7
@@
static int usage_with_options_internal(struct parse_opt_ctx_t *ctx,
const struct option *opts, int full, int err)
{
FILE *outfile = err ? stderr : stdout;
const struct option *opts, int full, int err)
{
FILE *outfile = err ? stderr : stdout;
+ int need_newline;
if (!usagestr)
return PARSE_OPT_HELP;
if (!usagestr)
return PARSE_OPT_HELP;
@@
-599,12
+600,11
@@
static int usage_with_options_internal(struct parse_opt_ctx_t *ctx,
if (**usagestr)
fprintf_ln(outfile, _(" %s"), _(*usagestr));
else
if (**usagestr)
fprintf_ln(outfile, _(" %s"), _(*usagestr));
else
-
putchar('\n'
);
+
fputc('\n', outfile
);
usagestr++;
}
usagestr++;
}
- if (opts->type != OPTION_GROUP)
- fputc('\n', outfile);
+ need_newline = 1;
for (; opts->type != OPTION_END; opts++) {
size_t pos;
for (; opts->type != OPTION_END; opts++) {
size_t pos;
@@
-612,6
+612,7
@@
static int usage_with_options_internal(struct parse_opt_ctx_t *ctx,
if (opts->type == OPTION_GROUP) {
fputc('\n', outfile);
if (opts->type == OPTION_GROUP) {
fputc('\n', outfile);
+ need_newline = 0;
if (*opts->help)
fprintf(outfile, "%s\n", _(opts->help));
continue;
if (*opts->help)
fprintf(outfile, "%s\n", _(opts->help));
continue;
@@
-619,6
+620,11
@@
static int usage_with_options_internal(struct parse_opt_ctx_t *ctx,
if (!full && (opts->flags & PARSE_OPT_HIDDEN))
continue;
if (!full && (opts->flags & PARSE_OPT_HIDDEN))
continue;
+ if (need_newline) {
+ fputc('\n', outfile);
+ need_newline = 0;
+ }
+
pos = fprintf(outfile, " ");
if (opts->short_name) {
if (opts->flags & PARSE_OPT_NODASH)
pos = fprintf(outfile, " ");
if (opts->short_name) {
if (opts->flags & PARSE_OPT_NODASH)