Skip to content

Commit 26cae57

Browse files
committed
fix(help): compopt needs a help entry, and the wiki page regenerating
`make help-test` asserts that every name in the dispatch table has a help entry, and 3.1.3 registered compopt without one -- the same obligation the completion table enforces, which caught the same omission earlier in the same change. Both gates exist because a builtin nobody can look up is a builtin nobody finds. wiki/builtins/index.md is generated from that table (tools/gen_builtins_md.py, `make docs-builtins`) and says so at the top, so it is regenerated here rather than edited: the entry lands and the count moves with it.
1 parent cbfe4c9 commit 26cae57

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

‎src/builtins/help_data2.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ static const t_help g_help_2[] = {
2828
{"complete", "shell",
2929
"complete [-abcdfkv] [-A action] [-W list] [-F fn] [-pr] name ...",
3030
"register what to offer when completing an argument of name"},
31+
{"compopt", "shell",
32+
"compopt [-o|+o option] [-DEI] [name ...]",
33+
"change a completion spec's options, or the running one's"},
3134
{"shopt", "shell",
3235
"shopt [-pqsu] [-o] [optname ...]",
3336
"toggle the extra (non-POSIX) shell options"},

‎wiki/builtins/index.md‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
> (tools/gen_builtins_md.py), never edit it by hand. The help
77
> table itself is test-enforced against the dispatch table, so
88
> neither this page nor `help` can drift from what actually
9-
> runs. 69 builtins; anything else on `$PATH` works as usual —
9+
> runs. 72 builtins; anything else on `$PATH` works as usual —
1010
> `type NAME` says which is which.
1111
1212
## navigation
@@ -31,16 +31,16 @@
3131
**`echo`** — `echo [-neE] [arg ...]`
3232
<br>write arguments (-n no newline, -e escapes)
3333

34-
**`mapfile`** — `mapfile [-t] [-n n] [-O i] [-s n] [-u fd] [array]`
34+
**`mapfile`** — `mapfile [-d delim] [-n n] [-O idx] [-s n] [-t] [-u fd] [array]`
3535
<br>read lines of input into an array
3636

3737
**`printf`** — `printf [-v var] format [arg ...]`
3838
<br>format and print, like printf(3)
3939

40-
**`read`** — `read [-r] [-p prompt] [-n n] [-t sec] [name ...]`
40+
**`read`** — `read [-r] [-a arr] [-d delim] [-n n] [-N n] [-p str] [-t s] [name ...]`
4141
<br>read one line into variables
4242

43-
**`readarray`** — `readarray [-t] [-n n] [-O i] [-s n] [array]`
43+
**`readarray`** — `readarray [-d delim] [-n n] [-O idx] [-s n] [-t] [-u fd] [array]`
4444
<br>same as mapfile
4545

4646
**`umask`** — `umask [-S] [-p] [mode]`
@@ -108,6 +108,9 @@
108108
**`alias`** — `alias [-p] [name[=value] ...]`
109109
<br>define or list command aliases
110110

111+
**`builtin`** — `builtin [name [args ...]]`
112+
<br>run a shell builtin, bypassing function lookup
113+
111114
**`command`** — `command [-pVv] name [arg ...]`
112115
<br>run a command, ignoring functions and aliases
113116

@@ -159,6 +162,9 @@
159162
**`complete`** — `complete [-abcdfkv] [-A action] [-W list] [-F fn] [-pr] name ...`
160163
<br>register what to offer when completing an argument of name
161164

165+
**`compopt`** — `compopt [-o|+o option] [-DEI] [name ...]`
166+
<br>change a completion spec's options, or the running one's
167+
162168
**`eval`** — `eval [arg ...]`
163169
<br>join the arguments and run them as a command
164170

@@ -202,6 +208,9 @@ Not builtins — the grammar `help` also explains, kept here for the same one-st
202208
**`for`** — `for NAME [in WORD ...]; do LIST; done`
203209
<br>loop over words
204210

211+
**`select`** — `select NAME [in WORD ...]; do LIST; done`
212+
<br>menu loop: number the words on stderr, read a choice into NAME
213+
205214
**`for((`** — `for ((exp1; exp2; exp3)); do LIST; done`
206215
<br>C-style counting loop
207216

@@ -257,6 +266,9 @@ Only reachable when the dialect is armed (`set -o zsh`, `emulate zsh`, or sourci
257266
**`emulate`** — `emulate [-L] {zsh|sh|ksh|bash}`
258267
<br>switch dialect; in a function it reverts on return
259268

269+
**`is-at-least`** — `is-at-least need [have]`
270+
<br>0 when version have (default $ZSH_VERSION) is need or newer
271+
260272
**`print`** — `print [-nrlP] [--] [arg ...]`
261273
<br>zsh's echo: escapes on by default, -r turns them off
262274

0 commit comments

Comments
 (0)