This commit is contained in:
Raven Scott
2026-04-03 17:56:46 -04:00
parent a7e08e093c
commit ec236f9cc7
28 changed files with 1052 additions and 97 deletions
@@ -11,7 +11,7 @@ import { COREUTILS_COMMANDS, MAN_EXTRA_PAGES } from '../lib/commands.mjs'
const __dirname = dirname(fileURLToPath(import.meta.url))
const pagesDir = join(__dirname, '../man/pages')
const STUB = new Set(['chgrp', 'chown', 'xargs', 'getconf', 'mkfifo'])
const STUB = new Set(['chgrp', 'chown', 'mkfifo'])
const POSIX_TITLE = {
awk: 'pattern scanning and processing language',
@@ -184,7 +184,8 @@ EXAMPLES.find = [
{ caption: 'OR names', code: 'find . \\( -name "*.c" -o -name "*.h" \\)' }
]
EXAMPLES.getconf = [
{ caption: 'stub', code: '# getconf PATH_MAX — not available on Bare OS' }
{ caption: 'path length limit', code: 'getconf PATH_MAX' },
{ caption: 'list known names and values', code: 'getconf -a' }
]
EXAMPLES.grep = [
{ caption: 'recursive feel (grep each file)', code: 'grep -n error *.log' },
@@ -327,7 +328,15 @@ EXAMPLES.which = [{ caption: 'resolve on PATH', code: 'which ls' }]
EXAMPLES.whoami = [{ caption: 'effective user', code: 'whoami' }]
EXAMPLES.xargs = [
{
caption: 'workaround: shell word split',
caption: 'pass lines as arguments',
code: "printf 'a\\nb\\n' | xargs echo"
},
{
caption: 'one argument per run',
code: "printf 'a\\nb\\n' | xargs -n1 echo"
},
{
caption: 'workaround for complex scripts',
code: '# for f in *.txt; do grep -l foo $f; done'
}
]
@@ -349,13 +358,25 @@ EXTRA.chown = {
}
EXTRA.xargs = {
description:
'xargs does not spawn arbitrary /bin utilities on Bare OS. Use shell word splitting or pipelines.',
bareOsNotes: 'No process fork model; see handbook ch.9.'
'Reads stdin into argument batches and runs **`ctx.runBinCommand`** (same as the shell). Enforces stdin size, token count, batch size, and invocation limits for safety.',
options: [
{ flag: '-0, --null', meaning: 'Input items are null-terminated, not whitespace-separated' },
{
flag: '-n, --max-args',
meaning: 'Up to N arguments per utility invocation (capped at 128)'
}
],
bareOsNotes:
'No host process spawn; not full POSIX xargs (no -I, -P, etc.). See src/xargs.js for limits.'
}
EXTRA.getconf = {
description:
'Host sysconf-style values are not exposed. The command prints an error.',
bareOsNotes: 'Stub only; no kernel sysconf surface.'
'Prints a fixed subset of configuration limits for Bare OS (JavaScript runtime and VFS). There is no host sysconf(3); values are documented constants, not live kernel queries.',
options: [
{ flag: '-a', meaning: 'Write all known variables (name then value per pair)' }
],
bareOsNotes:
'Unknown variable names exit with status 1. Not a full Issue 7 getconf implementation.'
}
EXTRA.mkfifo = {
description: