From: Charles Bailey Date: Sun, 21 Jun 2015 18:30:26 GMT Subject: Re: [PATCH 2/2] Move unsigned long option parsing out of pack-objects.c Message-ID: <20150621183026.GA7199@hashpling.org> In-Reply-To: <1434911144-6781-3-git-send-email-charles@hashpling.org> On Sun, Jun 21, 2015 at 07:25:44PM +0100, Charles Bailey wrote: > From: Charles Bailey > > diff --git a/parse-options.c b/parse-options.c > index 80106c0..101b649 100644 > --- a/parse-options.c > +++ b/parse-options.c > @@ -180,6 +180,23 @@ static int get_value(struct parse_opt_ctx_t *p, > return opterror(opt, "expects a numerical value", flags); > return 0; > > + case OPTION_MAGNITUDE: > + if (unset) { > + *(unsigned long *)opt->value = 0; > + return 0; > + } > + if (opt->flags & PARSE_OPT_OPTARG && !p->opt) { > + *(unsigned long *)opt->value = opt->defval; > + return 0; > + } > + if (get_arg(p, opt, flags, &arg)) > + return -1; > + if (!git_parse_ulong(arg, opt->value)) > + return opterror(opt, > + "expects a integer value with an optional k/m/g suffix", > + flags); > + return 0; > + Spotted after sending: s/expects a integer/expects an integer/