From 1b251a08f8c10ff292d1ca9b1c580e88df483b94 Mon Sep 17 00:00:00 2001 From: johannst Date: Mon, 26 Jun 2023 19:23:26 +0000 Subject: deploy: e730452fd8bd6824d35f25f2e87b8ec788b626fd --- tools/zsh.html | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'tools/zsh.html') diff --git a/tools/zsh.html b/tools/zsh.html index 6b5eaab..04cdbde 100644 --- a/tools/zsh.html +++ b/tools/zsh.html @@ -378,8 +378,8 @@ blu -- desc for blu

where SPEC can have one of the following forms:

Available actions

(op1 op2)   list possible matches
@@ -416,6 +416,25 @@ function _foo() {
     esac
 }
 
+

Example with optional arguments

+

For this example we assume that the command foo takes at least three optional +arguments such as

+
foo arg1 arg2 arg3 [argN..]
+
+
function _foo() {
+    _arguments              \
+        "1:opt 1:(a b c)"   \
+        ":opt next:(d e f)" \
+        "*:opt all:(u v w)"
+}
+
+

Explanation:

+

_files is a zsh builtin utility function to complete files/dirs see