[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.90-82-gf8b28a5
Ville Skyttä
ville.skytta at iki.fi
Sun Dec 4 20:32:16 UTC 2011
The following commit has been merged in the master branch:
commit f8b28a5827e1c2199f7a97c7d0b39f67a47975a8
Author: Raphaël Droz <raphael.droz+floss at gmail.com>
Date: Sun Dec 4 22:29:57 2011 +0200
Added a word about compopt -o nospace in styleguide.txt.
Modified-by: Ville Skyttä <ville.skytta at iki.fi>
diff --git a/doc/styleguide.txt b/doc/styleguide.txt
index 0f7ec25..12b224f 100644
--- a/doc/styleguide.txt
+++ b/doc/styleguide.txt
@@ -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.
+[[ $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
---------------
--
bash-completion
More information about the Bash-completion-commits
mailing list