[Bash-completion-devel] Presenting long options that require args as --foo=

Ville Skyttä ville.skytta at iki.fi
Mon Apr 25 09:03:14 UTC 2011


Hello,

Now that long option splitting works again and we have no bash < 4
baggage that makes it difficult to get things right wrt. this, I suggest
we start outputting long options that take arguments in tools that can
take them separated with the equals sign with the equals sign included.
 That'd make it clearer for users when an argument is required.

So if --foo requires an argument, we'd output "--foo=" in completions
instead of "--foo".  All that's needed AFAICS is just adding the equals
signs where appropriate, and setting -o nospace when there's only one
completion result that ends with the equals sign.

Example change for xz is attached.  Some of xz's long options can take
an argument but do not require one, I think it's a judgement call
whether to include the equals sign or not considering the most common
usage cases.  For example in this patch --files and --files0 are
completed with the equals sign even though they don't strictly require
an argument, and it is left out for --lzma1, --lzma2, --x86 etc even
though they can take an argument.

Thoughts?  If there are no objections, I'll add this to my TODO list.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: xz-eq-sign.patch
URL: <http://lists.alioth.debian.org/pipermail/bash-completion-devel/attachments/20110425/86efce46/attachment.asc>


More information about the Bash-completion-devel mailing list