Implement take command and comments (--) + misc cleanup

This commit is contained in:
2026-04-10 10:48:21 -05:00
parent 4dec54893c
commit 525f4bd065
8 changed files with 118 additions and 4 deletions

View File

@@ -28,7 +28,10 @@ import * as fs from "node:fs";
const exec = new Executor(output, parser, input)
exec.adoptLifecycle(lifecycle)
exec.subscribe(state => state.outputSubject())
console.log('`str` : An interactive string manipulation environment')
console.log('Copyright (C) 2026 Garrett Mills <shout@garrettmills.dev>')
console.log('')
const rcFile = processPath('~/.str.rc')
if ( fs.existsSync(rcFile) ) {
@@ -36,8 +39,11 @@ import * as fs from "node:fs";
const rcFileContent = fs.readFileSync(rcFile).toString()
await input.pushLines('\n' + rcFileContent)
console.log('Successfully loaded ~/.str.rc\n')
}
exec.subscribe(state => state.outputSubject())
input.setupPrompt()
process.on('SIGINT', () => lifecycle.close())