rename cow files to bare files
This commit is contained in:
+9
-9
@@ -196,7 +196,7 @@ function bareBaresayRainbowCodes() {
|
||||
]
|
||||
}
|
||||
|
||||
/** Extract cow body from .cow text (Perl heredoc or raw template). */
|
||||
/** Extract figure body from .bare template text (Perl heredoc or raw). */
|
||||
function bareBaresayExtractCow(raw) {
|
||||
const s = String(raw || '').replace(/^\ufeff/, '')
|
||||
// cowsay uses: $the_cow = <<"EOC"; ← semicolon before newline
|
||||
@@ -367,17 +367,17 @@ async function run(ctx, argv) {
|
||||
if (a === '-f' || a === '--file') {
|
||||
const v = argv[++i]
|
||||
if (v == null) {
|
||||
usage('missing cow file')
|
||||
usage('missing character file')
|
||||
return
|
||||
}
|
||||
if (v.startsWith('/') || v.startsWith('.')) cowPath = v
|
||||
else cowKey = v.replace(/\.cow$/i, '')
|
||||
else cowKey = v.replace(/\.(bare|cow)$/i, '')
|
||||
continue
|
||||
}
|
||||
if (a.startsWith('-f') && a.length > 2) {
|
||||
const v = a.slice(2)
|
||||
if (v.startsWith('/') || v.startsWith('.')) cowPath = v
|
||||
else cowKey = v.replace(/\.cow$/i, '')
|
||||
else cowKey = v.replace(/\.(bare|cow)$/i, '')
|
||||
continue
|
||||
}
|
||||
if (a === '-e') {
|
||||
@@ -429,8 +429,8 @@ async function run(ctx, argv) {
|
||||
if (!vfs || typeof vfs.readdir !== 'function') return names
|
||||
try {
|
||||
for await (const n of vfs.readdir(dir)) {
|
||||
if (typeof n === 'string' && n.endsWith('.cow')) {
|
||||
names.push(n.replace(/\.cow$/i, ''))
|
||||
if (typeof n === 'string' && /\.bare$/i.test(n)) {
|
||||
names.push(n.replace(/\.bare$/i, ''))
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
@@ -474,7 +474,7 @@ async function run(ctx, argv) {
|
||||
if (cowPath) {
|
||||
rawCow = (await readCowAt(cowPath)) || ''
|
||||
} else {
|
||||
const p = '/share/baresay/' + cowKey + '.cow'
|
||||
const p = '/share/baresay/' + cowKey + '.bare'
|
||||
rawCow = (await readCowAt(p)) || ''
|
||||
}
|
||||
if (!rawCow.trim()) {
|
||||
@@ -483,8 +483,8 @@ async function run(ctx, argv) {
|
||||
} else {
|
||||
ctx.console.error(
|
||||
prog +
|
||||
': cow file not found: ' +
|
||||
(cowPath || '/share/baresay/' + cowKey + '.cow')
|
||||
': character file not found: ' +
|
||||
(cowPath || '/share/baresay/' + cowKey + '.bare')
|
||||
)
|
||||
ctx.exitCode = 1
|
||||
return
|
||||
|
||||
+9
-9
@@ -196,7 +196,7 @@ function bareBaresayRainbowCodes() {
|
||||
]
|
||||
}
|
||||
|
||||
/** Extract cow body from .cow text (Perl heredoc or raw template). */
|
||||
/** Extract figure body from .bare template text (Perl heredoc or raw). */
|
||||
function bareBaresayExtractCow(raw) {
|
||||
const s = String(raw || '').replace(/^\ufeff/, '')
|
||||
// cowsay uses: $the_cow = <<"EOC"; ← semicolon before newline
|
||||
@@ -367,17 +367,17 @@ async function run(ctx, argv) {
|
||||
if (a === '-f' || a === '--file') {
|
||||
const v = argv[++i]
|
||||
if (v == null) {
|
||||
usage('missing cow file')
|
||||
usage('missing character file')
|
||||
return
|
||||
}
|
||||
if (v.startsWith('/') || v.startsWith('.')) cowPath = v
|
||||
else cowKey = v.replace(/\.cow$/i, '')
|
||||
else cowKey = v.replace(/\.(bare|cow)$/i, '')
|
||||
continue
|
||||
}
|
||||
if (a.startsWith('-f') && a.length > 2) {
|
||||
const v = a.slice(2)
|
||||
if (v.startsWith('/') || v.startsWith('.')) cowPath = v
|
||||
else cowKey = v.replace(/\.cow$/i, '')
|
||||
else cowKey = v.replace(/\.(bare|cow)$/i, '')
|
||||
continue
|
||||
}
|
||||
if (a === '-e') {
|
||||
@@ -429,8 +429,8 @@ async function run(ctx, argv) {
|
||||
if (!vfs || typeof vfs.readdir !== 'function') return names
|
||||
try {
|
||||
for await (const n of vfs.readdir(dir)) {
|
||||
if (typeof n === 'string' && n.endsWith('.cow')) {
|
||||
names.push(n.replace(/\.cow$/i, ''))
|
||||
if (typeof n === 'string' && /\.bare$/i.test(n)) {
|
||||
names.push(n.replace(/\.bare$/i, ''))
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
@@ -474,7 +474,7 @@ async function run(ctx, argv) {
|
||||
if (cowPath) {
|
||||
rawCow = (await readCowAt(cowPath)) || ''
|
||||
} else {
|
||||
const p = '/share/baresay/' + cowKey + '.cow'
|
||||
const p = '/share/baresay/' + cowKey + '.bare'
|
||||
rawCow = (await readCowAt(p)) || ''
|
||||
}
|
||||
if (!rawCow.trim()) {
|
||||
@@ -483,8 +483,8 @@ async function run(ctx, argv) {
|
||||
} else {
|
||||
ctx.console.error(
|
||||
prog +
|
||||
': cow file not found: ' +
|
||||
(cowPath || '/share/baresay/' + cowKey + '.cow')
|
||||
': character file not found: ' +
|
||||
(cowPath || '/share/baresay/' + cowKey + '.bare')
|
||||
)
|
||||
ctx.exitCode = 1
|
||||
return
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"schema": 2,
|
||||
"profileId": "bare-os-posix-like",
|
||||
"generatedAt": "2026-04-21T23:36:19.353Z",
|
||||
"generatedAt": "2026-04-21T23:43:49.967Z",
|
||||
"note": "Sparse POSIX Issue 7 coverage hints for /bin utilities. Omitted command names are not yet profiled here.",
|
||||
"commandIndex": [
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"schema": 1,
|
||||
"atMs": 1776814579352,
|
||||
"atMs": 1776815029966,
|
||||
"commands": [
|
||||
"arch",
|
||||
"awk",
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -107,7 +107,7 @@ function bareBaresayRainbowCodes() {
|
||||
]
|
||||
}
|
||||
|
||||
/** Extract cow body from .cow text (Perl heredoc or raw template). */
|
||||
/** Extract figure body from .bare template text (Perl heredoc or raw). */
|
||||
function bareBaresayExtractCow(raw) {
|
||||
const s = String(raw || '').replace(/^\ufeff/, '')
|
||||
// cowsay uses: $the_cow = <<"EOC"; ← semicolon before newline
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
"synopsis": [
|
||||
"baresay [OPTION]... [MESSAGE...]"
|
||||
],
|
||||
"description": "Like cowsay for Bare OS: wraps MESSAGE (or stdin, if none) in a speech balloon and prints it above an ASCII character read from /share/baresay/<name>.cow. Default character is bear. Full behavior is in packages/bare-os-coreutils/src/baresay.js and lib/baresay-engine.js.",
|
||||
"description": "Like cowsay for Bare OS: wraps MESSAGE (or stdin, if none) in a speech balloon and prints it above an ASCII character read from /share/baresay/<name>.bare. Default character is bear. Full behavior is in packages/bare-os-coreutils/src/baresay.js and lib/baresay-engine.js.",
|
||||
"files": [
|
||||
"/share/baresay/*.cow — ASCII templates with $thoughts, $eyes, $L (left eye), $R (right eye), $tongue"
|
||||
"/share/baresay/*.bare — ASCII templates with $thoughts, $eyes, $L (left eye), $R (right eye), $tongue"
|
||||
],
|
||||
"options": [
|
||||
{
|
||||
@@ -20,7 +20,7 @@
|
||||
},
|
||||
{
|
||||
"flag": "-f NAME|-f PATH",
|
||||
"meaning": "Character: bare NAME loads /share/baresay/NAME.cow; PATH loads that file."
|
||||
"meaning": "Character: NAME loads /share/baresay/NAME.bare; PATH loads that file."
|
||||
},
|
||||
{
|
||||
"flag": "--file NAME|PATH",
|
||||
@@ -28,7 +28,7 @@
|
||||
},
|
||||
{
|
||||
"flag": "-l",
|
||||
"meaning": "List names (basename of each .cow under /share/baresay)."
|
||||
"meaning": "List names (basename of each .bare under /share/baresay)."
|
||||
},
|
||||
{
|
||||
"flag": "-e XX",
|
||||
@@ -56,7 +56,7 @@
|
||||
},
|
||||
{
|
||||
"flag": "-R",
|
||||
"meaning": "Pick a random .cow from /share/baresay."
|
||||
"meaning": "Pick a random .bare from /share/baresay."
|
||||
},
|
||||
{
|
||||
"flag": "--random",
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"synopsis": [
|
||||
"say [OPTION]... [MESSAGE...]"
|
||||
],
|
||||
"description": "Same program as baresay (packages/bare-os-coreutils/src/baresay.js); only the default argv[0] label in messages differs. See man baresay for options and /share/baresay/*.cow.",
|
||||
"description": "Same program as baresay (packages/bare-os-coreutils/src/baresay.js); only the default argv[0] label in messages differs. See man baresay for options and /share/baresay/*.bare.",
|
||||
"options": [],
|
||||
"keywords": [
|
||||
"say",
|
||||
|
||||
@@ -83,17 +83,17 @@ async function run(ctx, argv) {
|
||||
if (a === '-f' || a === '--file') {
|
||||
const v = argv[++i]
|
||||
if (v == null) {
|
||||
usage('missing cow file')
|
||||
usage('missing character file')
|
||||
return
|
||||
}
|
||||
if (v.startsWith('/') || v.startsWith('.')) cowPath = v
|
||||
else cowKey = v.replace(/\.cow$/i, '')
|
||||
else cowKey = v.replace(/\.(bare|cow)$/i, '')
|
||||
continue
|
||||
}
|
||||
if (a.startsWith('-f') && a.length > 2) {
|
||||
const v = a.slice(2)
|
||||
if (v.startsWith('/') || v.startsWith('.')) cowPath = v
|
||||
else cowKey = v.replace(/\.cow$/i, '')
|
||||
else cowKey = v.replace(/\.(bare|cow)$/i, '')
|
||||
continue
|
||||
}
|
||||
if (a === '-e') {
|
||||
@@ -145,8 +145,8 @@ async function run(ctx, argv) {
|
||||
if (!vfs || typeof vfs.readdir !== 'function') return names
|
||||
try {
|
||||
for await (const n of vfs.readdir(dir)) {
|
||||
if (typeof n === 'string' && n.endsWith('.cow')) {
|
||||
names.push(n.replace(/\.cow$/i, ''))
|
||||
if (typeof n === 'string' && /\.bare$/i.test(n)) {
|
||||
names.push(n.replace(/\.bare$/i, ''))
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
@@ -190,7 +190,7 @@ async function run(ctx, argv) {
|
||||
if (cowPath) {
|
||||
rawCow = (await readCowAt(cowPath)) || ''
|
||||
} else {
|
||||
const p = '/share/baresay/' + cowKey + '.cow'
|
||||
const p = '/share/baresay/' + cowKey + '.bare'
|
||||
rawCow = (await readCowAt(p)) || ''
|
||||
}
|
||||
if (!rawCow.trim()) {
|
||||
@@ -199,8 +199,8 @@ async function run(ctx, argv) {
|
||||
} else {
|
||||
ctx.console.error(
|
||||
prog +
|
||||
': cow file not found: ' +
|
||||
(cowPath || '/share/baresay/' + cowKey + '.cow')
|
||||
': character file not found: ' +
|
||||
(cowPath || '/share/baresay/' + cowKey + '.bare')
|
||||
)
|
||||
ctx.exitCode = 1
|
||||
return
|
||||
|
||||
@@ -196,7 +196,7 @@ function bareBaresayRainbowCodes() {
|
||||
]
|
||||
}
|
||||
|
||||
/** Extract cow body from .cow text (Perl heredoc or raw template). */
|
||||
/** Extract figure body from .bare template text (Perl heredoc or raw). */
|
||||
function bareBaresayExtractCow(raw) {
|
||||
const s = String(raw || '').replace(/^\ufeff/, '')
|
||||
// cowsay uses: $the_cow = <<"EOC"; ← semicolon before newline
|
||||
@@ -367,17 +367,17 @@ async function run(ctx, argv) {
|
||||
if (a === '-f' || a === '--file') {
|
||||
const v = argv[++i]
|
||||
if (v == null) {
|
||||
usage('missing cow file')
|
||||
usage('missing character file')
|
||||
return
|
||||
}
|
||||
if (v.startsWith('/') || v.startsWith('.')) cowPath = v
|
||||
else cowKey = v.replace(/\.cow$/i, '')
|
||||
else cowKey = v.replace(/\.(bare|cow)$/i, '')
|
||||
continue
|
||||
}
|
||||
if (a.startsWith('-f') && a.length > 2) {
|
||||
const v = a.slice(2)
|
||||
if (v.startsWith('/') || v.startsWith('.')) cowPath = v
|
||||
else cowKey = v.replace(/\.cow$/i, '')
|
||||
else cowKey = v.replace(/\.(bare|cow)$/i, '')
|
||||
continue
|
||||
}
|
||||
if (a === '-e') {
|
||||
@@ -429,8 +429,8 @@ async function run(ctx, argv) {
|
||||
if (!vfs || typeof vfs.readdir !== 'function') return names
|
||||
try {
|
||||
for await (const n of vfs.readdir(dir)) {
|
||||
if (typeof n === 'string' && n.endsWith('.cow')) {
|
||||
names.push(n.replace(/\.cow$/i, ''))
|
||||
if (typeof n === 'string' && /\.bare$/i.test(n)) {
|
||||
names.push(n.replace(/\.bare$/i, ''))
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
@@ -474,7 +474,7 @@ async function run(ctx, argv) {
|
||||
if (cowPath) {
|
||||
rawCow = (await readCowAt(cowPath)) || ''
|
||||
} else {
|
||||
const p = '/share/baresay/' + cowKey + '.cow'
|
||||
const p = '/share/baresay/' + cowKey + '.bare'
|
||||
rawCow = (await readCowAt(p)) || ''
|
||||
}
|
||||
if (!rawCow.trim()) {
|
||||
@@ -483,8 +483,8 @@ async function run(ctx, argv) {
|
||||
} else {
|
||||
ctx.console.error(
|
||||
prog +
|
||||
': cow file not found: ' +
|
||||
(cowPath || '/share/baresay/' + cowKey + '.cow')
|
||||
': character file not found: ' +
|
||||
(cowPath || '/share/baresay/' + cowKey + '.bare')
|
||||
)
|
||||
ctx.exitCode = 1
|
||||
return
|
||||
|
||||
@@ -196,7 +196,7 @@ function bareBaresayRainbowCodes() {
|
||||
]
|
||||
}
|
||||
|
||||
/** Extract cow body from .cow text (Perl heredoc or raw template). */
|
||||
/** Extract figure body from .bare template text (Perl heredoc or raw). */
|
||||
function bareBaresayExtractCow(raw) {
|
||||
const s = String(raw || '').replace(/^\ufeff/, '')
|
||||
// cowsay uses: $the_cow = <<"EOC"; ← semicolon before newline
|
||||
@@ -367,17 +367,17 @@ async function run(ctx, argv) {
|
||||
if (a === '-f' || a === '--file') {
|
||||
const v = argv[++i]
|
||||
if (v == null) {
|
||||
usage('missing cow file')
|
||||
usage('missing character file')
|
||||
return
|
||||
}
|
||||
if (v.startsWith('/') || v.startsWith('.')) cowPath = v
|
||||
else cowKey = v.replace(/\.cow$/i, '')
|
||||
else cowKey = v.replace(/\.(bare|cow)$/i, '')
|
||||
continue
|
||||
}
|
||||
if (a.startsWith('-f') && a.length > 2) {
|
||||
const v = a.slice(2)
|
||||
if (v.startsWith('/') || v.startsWith('.')) cowPath = v
|
||||
else cowKey = v.replace(/\.cow$/i, '')
|
||||
else cowKey = v.replace(/\.(bare|cow)$/i, '')
|
||||
continue
|
||||
}
|
||||
if (a === '-e') {
|
||||
@@ -429,8 +429,8 @@ async function run(ctx, argv) {
|
||||
if (!vfs || typeof vfs.readdir !== 'function') return names
|
||||
try {
|
||||
for await (const n of vfs.readdir(dir)) {
|
||||
if (typeof n === 'string' && n.endsWith('.cow')) {
|
||||
names.push(n.replace(/\.cow$/i, ''))
|
||||
if (typeof n === 'string' && /\.bare$/i.test(n)) {
|
||||
names.push(n.replace(/\.bare$/i, ''))
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
@@ -474,7 +474,7 @@ async function run(ctx, argv) {
|
||||
if (cowPath) {
|
||||
rawCow = (await readCowAt(cowPath)) || ''
|
||||
} else {
|
||||
const p = '/share/baresay/' + cowKey + '.cow'
|
||||
const p = '/share/baresay/' + cowKey + '.bare'
|
||||
rawCow = (await readCowAt(p)) || ''
|
||||
}
|
||||
if (!rawCow.trim()) {
|
||||
@@ -483,8 +483,8 @@ async function run(ctx, argv) {
|
||||
} else {
|
||||
ctx.console.error(
|
||||
prog +
|
||||
': cow file not found: ' +
|
||||
(cowPath || '/share/baresay/' + cowKey + '.cow')
|
||||
': character file not found: ' +
|
||||
(cowPath || '/share/baresay/' + cowKey + '.bare')
|
||||
)
|
||||
ctx.exitCode = 1
|
||||
return
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"schema": 2,
|
||||
"profileId": "bare-os-posix-like",
|
||||
"generatedAt": "2026-04-21T23:36:19.353Z",
|
||||
"generatedAt": "2026-04-21T23:43:49.967Z",
|
||||
"note": "Sparse POSIX Issue 7 coverage hints for /bin utilities. Omitted command names are not yet profiled here.",
|
||||
"commandIndex": [
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"schema": 1,
|
||||
"atMs": 1776814579352,
|
||||
"atMs": 1776815029966,
|
||||
"commands": [
|
||||
"arch",
|
||||
"awk",
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user