feat: add some utilities

This commit is contained in:
2026-03-26 22:33:04 +01:00
parent 21a1a34309
commit 983cf59476
10 changed files with 119 additions and 27 deletions

19
src/program/Lsprg.ts Normal file
View File

@@ -0,0 +1,19 @@
import type { Wush } from '../shell/Wush'
import type { SimpleStream } from '../utils/SimpleStream'
import { Program } from './Program'
export class Lsprg extends Program {
private wush: Wush
constructor(wush: Wush) {
super()
this.wush = wush
}
async Exec(_: SimpleStream<string>, stdout: SimpleStream<string>, __: string[]): Promise<number> {
for (const program in this.wush.GetPrograms())
stdout.emit(`${program}\n`)
return 0
}
}