Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions builtins/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,17 @@ var featureRegistry = []FeatureMeta{
},
{
Name: "control-flow",
Description: "for/if/&&/||/!/groups/subshells; no while/case/select/functions.",
Description: "for/while/until/if/&&/||/!/groups/subshells; no case/select/functions.",
Supported: []string{
"for VAR in WORDS; do CMDS; done.",
"while CONDITION; do CMDS; done — runs CMDS while the condition's last command exits 0.",
"until CONDITION; do CMDS; done — runs CMDS while the condition's last command exits non-zero.",
"if / elif / else conditionals.",
"AND/OR lists with && and ||, plus ! exit-code negation.",
"Brace groups with { CMDS; } and command separators with ; or newline.",
"Subshells with ( CMDS ); variable changes and exit are isolated from the parent shell.",
},
Unsupported: []string{
"while and until loops.",
"case and select statements.",
"C-style for loops: for (( ... )).",
"Shell functions: name() { ... }.",
Expand Down Expand Up @@ -140,7 +141,7 @@ var featureRegistry = []FeatureMeta{

var unsupportedSummary = []string{
"Expansions: arithmetic $((...)), arrays, advanced ${...} operations, tilde expansion, process substitution, extended globbing.",
"Control flow: while/until, case, select, C-style for ((...)), and shell functions.",
"Control flow: case, select, C-style for ((...)), and shell functions.",
"Execution: external commands by default, background jobs, coprocesses, time, [[...]], ((...)), declare/export/local/readonly/let.",
"I/O and environment: arbitrary output file redirects, |&, herestrings, read-write redirects, input fd duplication, host env inheritance.",
}
Expand Down
2 changes: 1 addition & 1 deletion builtins/tests/help/help_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func TestHelpListsFeaturesAndUnsupportedSummary(t *testing.T) {
assert.Contains(t, stdout, "pipes-redirections")
assert.Contains(t, stdout, "Not supported:")
assert.Contains(t, stdout, "arithmetic $((...))")
assert.Contains(t, stdout, "while/until")
assert.Contains(t, stdout, "case, select")
assert.Contains(t, stdout, "arbitrary output file redirects")
}

Expand Down
4 changes: 2 additions & 2 deletions tests/scenarios/cmd/help/unrestricted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ expect:
- "commands available"
- "Features:"
- "commands Registered commands run inside the interpreter"
- "control-flow for/if/&&/||/!/groups/subshells"
- "control-flow for/while/until/if/&&/||/!/groups/subshells"
- "Not supported:"
- "arithmetic $((...))"
- "while/until"
- "case, select"
- "Commands:"
- "echo"
- "write arguments to stdout"
Expand Down
Loading