brsh 2.3.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [2.4.0](https://github.com/eliotstocker/Brsh-JS/compare/v2.3.0...v2.4.0) (2026-05-23)
2
+
3
+
4
+ ### Features
5
+
6
+ * quick pipes imp ([b783c3d](https://github.com/eliotstocker/Brsh-JS/commit/b783c3d781ff41302c3d073c0b9b51f3b321d2a0))
7
+
1
8
  # [2.3.0](https://github.com/eliotstocker/Brsh-JS/compare/v2.2.1...v2.3.0) (2026-05-23)
2
9
 
3
10
 
@@ -0,0 +1,158 @@
1
+ # POSIX Shell Compatibility Checklist
2
+
3
+ Track progress toward a POSIX-compliant `sh` implementation in Brsh-JS.
4
+
5
+ ---
6
+
7
+ ## Shell Syntax & Built-in Behaviour
8
+
9
+ ### Operators / Redirection
10
+ - [x] Pipes (`|`) — `cmd1 | cmd2`
11
+ - [x] Logical AND (`&&`)
12
+ - [x] Logical OR (`||`)
13
+ - [x] Sequential (`;`)
14
+ - [x] Output redirect (`>`, `>>`)
15
+ - [ ] Input redirect (`<`)
16
+ - [ ] Here-doc (`<<EOF … EOF`)
17
+ - [ ] Here-string (`<<<`)
18
+ - [ ] Process substitution (`<(cmd)`, `>(cmd)`) *(non-POSIX but common)*
19
+
20
+ ### Control Flow
21
+ - [x] `if` / `elif` / `else` / `fi`
22
+ - [x] `while` / `do` / `done`
23
+ - [x] `for var in list; do … done`
24
+ - [x] `case … in … esac`
25
+ - [ ] `break [n]` — exit loop
26
+ - [ ] `continue [n]` — next iteration
27
+ - [ ] Subshell `( cmds )`
28
+
29
+ ### Functions
30
+ - [x] `name() { … }` definition
31
+ - [x] `function name { … }` definition
32
+ - [x] `return [n]`
33
+ - [x] Positional parameters (`$1`, `$2`, … inside function)
34
+ - [ ] `local var` — function-scoped variables
35
+
36
+ ### Variable Expansion
37
+ - [x] `$VAR` / `${VAR}`
38
+ - [x] `$?` — last exit code
39
+ - [x] `$#` — positional parameter count
40
+ - [x] `$1` … `$n` — positional parameters
41
+ - [ ] `$@` — all positional params as separate words
42
+ - [ ] `$*` — all positional params as single word
43
+ - [ ] `$0` — script / shell name
44
+ - [ ] `$$` — current PID *(can be faked)*
45
+ - [ ] `${var:-default}` — use default if unset/empty
46
+ - [ ] `${var:=default}` — assign default if unset/empty
47
+ - [ ] `${var:?error}` — error if unset/empty
48
+ - [ ] `${var:+alt}` — use alt if set
49
+ - [ ] `${#var}` — string length
50
+ - [ ] `${var#pattern}` — strip shortest prefix
51
+ - [ ] `${var##pattern}` — strip longest prefix
52
+ - [ ] `${var%pattern}` — strip shortest suffix
53
+ - [ ] `${var%%pattern}` — strip longest suffix
54
+ - [ ] `${var/from/to}` — replace first *(non-POSIX but common)*
55
+ - [ ] `${var//from/to}` — replace all *(non-POSIX but common)*
56
+
57
+ ### Expansion
58
+ - [x] Command substitution `$(cmd)`
59
+ - [x] Arithmetic expansion `$((expr))`
60
+ - [ ] Tilde expansion (`~`, `~user`)
61
+ - [ ] Filename glob expansion (`*`, `?`, `[a-z]`)
62
+ - [ ] Brace expansion `{a,b,c}` *(non-POSIX but common)*
63
+
64
+ ### Special Built-ins (POSIX required)
65
+ - [x] `exit [n]`
66
+ - [x] `export VAR=val`
67
+ - [x] `return [n]`
68
+ - [x] `set` (flags + positional params)
69
+ - [x] `source` / `. script` *(`.` alias missing — see below)*
70
+ - [x] `.` — dot command (alias for `source`)
71
+ - [ ] `:` — no-op, always exits 0
72
+ - [ ] `break [n]`
73
+ - [ ] `continue [n]`
74
+ - [ ] `shift [n]`
75
+ - [ ] `unset var`
76
+ - [ ] `readonly var`
77
+ - [ ] `eval string`
78
+ - [ ] `exec [cmd]`
79
+ - [ ] `trap cmd sig`
80
+ - [ ] `times`
81
+ - [ ] `wait [pid]`
82
+ - [ ] `getopts optstring var`
83
+
84
+ ### Other Shell Features
85
+ - [x] `set -e` (errexit)
86
+ - [x] `set -x` (xtrace)
87
+ - [ ] `set -u` (nounset — flag stored but not enforced)
88
+ - [ ] `set -n` (noexec — flag stored but not enforced)
89
+ - [ ] `set -o pipefail` *(non-POSIX but common)*
90
+
91
+ ---
92
+
93
+ ## Commands / Utilities
94
+
95
+ ### Text Processing
96
+ - [x] `echo`
97
+ - [x] `printf`
98
+ - [x] `cat`
99
+ - [x] `grep`
100
+ - [ ] `wc`
101
+ - [ ] `head`
102
+ - [ ] `tail`
103
+ - [ ] `sort`
104
+ - [ ] `uniq`
105
+ - [ ] `tr`
106
+ - [ ] `cut`
107
+ - [ ] `tee` *(requires pipe support)*
108
+ - [ ] `sed`
109
+ - [ ] `awk`
110
+
111
+ ### Filesystem
112
+ - [x] `ls`
113
+ - [x] `cp`
114
+ - [x] `mv`
115
+ - [x] `rm`
116
+ - [x] `mkdir`
117
+ - [x] `chmod`
118
+ - [x] `cd` / `pwd`
119
+ - [ ] `touch`
120
+ - [ ] `find`
121
+ - [ ] `ln` (symlinks)
122
+ - [ ] `stat`
123
+
124
+ ### Path Utilities
125
+ - [ ] `basename`
126
+ - [ ] `dirname`
127
+ - [ ] `realpath` *(non-POSIX but common)*
128
+
129
+ ### System / Misc
130
+ - [ ] `date`
131
+ - [ ] `sleep`
132
+ - [ ] `env` / `printenv`
133
+ - [ ] `kill`
134
+ - [ ] `xargs`
135
+ - [ ] `test` (as standalone command) — `[` and `[[` covered by `test` builtin
136
+ - [x] `which`
137
+ - [x] `true`
138
+ - [x] `false`
139
+ - [x] `read`
140
+ - [x] `alias`
141
+ - [x] `exit`
142
+
143
+ ---
144
+
145
+ ## Priority Order
146
+
147
+ 1. **Pipes (`|`)** — unlocks most shell idioms; highest value
148
+ 2. **`break` / `continue`** — small change, very common in loops
149
+ 3. **`shift` / `unset` / `.` / `:`** — small special builtins, high frequency in scripts
150
+ 4. **`$@` / `$*` / `$0`** — needed for argument-forwarding patterns
151
+ 5. **`${var:-default}` parameter expansion forms** — very common in real scripts
152
+ 6. **`wc`, `head`, `tail`, `sort`, `uniq`, `tr`, `cut`** — most-used text utilities
153
+ 7. **`basename` / `dirname`** — common path helpers
154
+ 8. **`local`** — function-scoped variables
155
+ 9. **`date`, `sleep`, `touch`** — misc utilities
156
+ 10. **`set -u` enforcement** — nounset mode
157
+ 11. **Glob expansion** — needed for `ls *.txt` style usage
158
+ 12. **`sed` / `awk`** — complex; consider wasm or partial implementation