The following commit has been merged in the master branch:
commit f8b28a5827e1c2199f7a97c7d0b39f67a47975a8
Author: Raphaël Droz <[email protected]>
Date: Sun Dec 4 22:29:57 2011 +0200
Added a word about compopt -o nospace in styleguide.txt.
Modified-by: Ville Skyttä <[email protected]>
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
_______________________________________________
Bash-completion-commits mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/bash-completion-commits