Added a word about compopt -o nospace in styleguide.txt.

Modified-by: Ville Skyttä <ville.skytta@iki.fi>
This commit is contained in:
Raphaël Droz 2011-12-04 22:29:57 +02:00 committed by Ville Skyttä
parent 98fe4713a3
commit f8b28a5827

View File

@ -61,6 +61,20 @@ need that kind of processing (e.g. file and command names). The
_filedir and _filedir_xspec helpers do this automatically whenever
they return some completions.
&#91;[ $COMPREPLY == *= ]] && compopt -o nospace
------------------------------------------------
The above is functionally a shorthand for:
----
if [[ ${#COMPREPLY[@]} -eq 1 && ${COMPREPLY[0]} == *= ]]; then
compopt -o nospace
fi
----
It is used to ensure that long options' name won't get a space
appended after the equal sign. Calling compopt -o nospace makes sense
in case completion actually occurs: when only one completion is
available in COMPREPLY.
/////////////////////////////////////////
case/esac vs if
---------------