On Sat, 2010-06-12 at 11:07 +0200, ext Yin Kangkai wrote:
> On 2010-06-12, 16:50 +0800, Ameya Palande wrote:
> > > > -options=$(getopt -o qvd:F: --long quilt,symbol:,dir:,fuzz: -- "$@")
> > > > +options=$(getopt -o :vd:F:q --long verbose,dir:,fuzz:,quilt -- "$@")
> > >                        ^ do we need the leading ':'?
> > 
> > With leading ':'
> > -------------------------
> > am...@chotu:~/repos/kernel-source$ ./scripts/sequence-patch.sh --test
> > Usage: sequence-patch.sh [OPTION]
> > -------------------------
> 
> What is the return value, i.e.: $?

Return value will be 1, since I am not modifying usage() function.

> > Without leading ':' we get the following getopt warning
> > -------------------------
> > am...@chotu:~/repos/kernel-source$ ./scripts/sequence-patch.sh --test
> > getopt: unrecognized option '--test'
> > Usage: sequence-patch.sh [OPTION]
> > -------------------------
> 
> Is that a trick to support unsupported options? :)

No. The trick is to get rid of "getopt:" string in the warning.

> But we actually don't support "--test" (or --anythingelse), right? So

Yes! We don't support these options.

> when you specify the "--test", the right behaviour is give a warning,
> and return value (i.e.: $?) is none-zero. Otherwise we break that
> semantic. NO?

I will send v3 of the patch which will give warning but won't print
"getopt:" string.

Thanks for the review!

Cheers,
Ameya.

_______________________________________________
MeeGo-dev mailing list
[email protected]
http://lists.meego.com/listinfo/meego-dev

Reply via email to