Skip to content

Commit bf07dc3

Browse files
committed
Populate playground's "Available commands" list from WASM_COMMANDS
Replaces the hand-maintained inline-code list in playground.md with a placeholder that the page script fills from the build-generated WASM_COMMANDS, so the prose section stays in sync with the actual feat_wasm contents of the WASM binary.
1 parent c5907a4 commit bf07dc3

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

content/playground.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ template = "page.html"
3535
sel.appendChild(opt);
3636
});
3737
}
38+
// Populate the "Available commands" list from the build-generated list
39+
if (typeof WASM_COMMANDS !== "undefined" && Array.isArray(WASM_COMMANDS)) {
40+
var listEl = document.getElementById("available-commands");
41+
if (listEl) {
42+
listEl.innerHTML = WASM_COMMANDS.slice().sort().map(function(c) {
43+
return "<code>" + c + "</code>";
44+
}).join(" ");
45+
}
46+
}
3847
// Show the uutils commit that was used to build the WASM binary
3948
if (typeof UUTILS_WASM_VERSION !== "undefined") {
4049
var el = document.getElementById("playground-version");
@@ -104,16 +113,7 @@ Multiple commands can be separated by newlines (`%0A` in the URL):
104113

105114
The following commands run as **real Rust coreutils compiled to WebAssembly**:
106115

107-
`arch` `b2sum` `base32` `base64` `basenc` `basename` `cat` `cksum`
108-
`comm` `cp` `csplit` `cut` `date` `dd` `dir` `dircolors` `dirname`
109-
`echo` `expand` `expr` `factor` `false` `fmt` `fold` `head`
110-
`join` `link` `ln` `ls` `md5sum` `mkdir` `mv` `nl` `nproc` `numfmt`
111-
`od` `paste` `pathchk` `printenv` `printf` `pr` `ptx` `pwd`
112-
`readlink` `realpath` `rm` `rmdir`
113-
`seq` `sort` `split` `tail` `touch` `tr` `tsort`
114-
`sha1sum` `sha224sum` `sha256sum` `sha384sum` `sha512sum`
115-
`shred` `shuf` `sleep` `sum` `tee` `true` `truncate`
116-
`uname` `unexpand` `uniq` `unlink` `vdir` `wc`
116+
<p id="available-commands">Loading the list of available commands…</p>
117117

118118
The following are **shell builtins** implemented in JavaScript:
119119

0 commit comments

Comments
 (0)