From: Jonathan Nieder Date: Sat, 21 Aug 2010 04:02:03 GMT Subject: Re: [PATCH v3 3/5] fmt-merge-msg: Update command line options to sync with config options Message-ID: <20100821040203.GA2636@burratino> In-Reply-To: <1282331702-5115-4-git-send-email-artagnon@gmail.com> Ramkumar Ramachandra wrote: > +++ b/builtin/fmt-merge-msg.c > @@ -7,11 +7,10 @@ > #include "string-list.h" > > static const char * const fmt_merge_msg_usage[] = { > - "git fmt-merge-msg [-m ] [--log|--no-log] [--file ]", > + "git fmt-merge-msg [-m ] [--log=[]|--no-log] [--file ]", [--log[=]], no? > NULL > }; > > -static int merge_summary; > static int log_limit = 0; Ah, so you elminate the boolean arg here. :) Nit: the usual style in git is to let statics and globals that should be 0 be implicitly initialized. > @@ -328,10 +326,12 @@ int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix) > const char *inpath = NULL; > const char *message = NULL; > struct option options[] = { > - OPT_BOOLEAN(0, "log", &merge_summary, "populate log with the shortlog"), > - { OPTION_BOOLEAN, 0, "summary", &merge_summary, NULL, > + { OPTION_INTEGER, 0, "log", &log_limit, "n", > + "populate log with entries from shortlog", > + PARSE_OPT_NOARG, NULL, 20 }, > + { OPTION_INTEGER, 0, "summary", &log_limit, "n", > "alias for --log (deprecated)", > - PARSE_OPT_NOARG | PARSE_OPT_HIDDEN }, > + PARSE_OPT_NOARG | PARSE_OPT_HIDDEN, NULL, 20 }, OPTARG, I think.