summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Etc/completion-style-guide20
2 files changed, 25 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index f05bb1240..f5e36572a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-06-16 dana <dana@dana.is>
+
+ * 43031: Etc/completion-style-guide: Add note about optional/variant
+ syntax (cf. 43025)
+
2018-06-15 dana <dana@dana.is>
* 43024: Completion/Unix/Command/_man: Improve section-name matching
diff --git a/Etc/completion-style-guide b/Etc/completion-style-guide
index a6fc737a7..ca99c828b 100644
--- a/Etc/completion-style-guide
+++ b/Etc/completion-style-guide
@@ -20,6 +20,26 @@ Coding style:
* Please try not to use lines longer than 79 characters. Don't worry
about breaking long `_arguments' or `_values' specs though.
+* Never use alternative, unusual, or optional syntax in completion
+ functions (or any other shell code distributed with zsh). In other
+ words, do NOT use the following:
+
+ # Short loops
+ for x in $y; myfunc $x
+
+ # Alternative forms
+ if { [[ $x == $y ]] } {
+ myfunc $x
+ }
+ foreach x in $y {
+ myfunc $x
+ }
+
+ # Weird tricks
+ () for 1 {
+ myfunc $1
+ } $x
+
Descriptions:
Descriptions should not have a trailing full stop and initial capital