MCPcopy Create free account
hub / github.com/breck7/scroll / executeUsersInstructionsFromShell

Method executeUsersInstructionsFromShell

simpleCli.js:19–26  ·  view source on GitHub ↗
(args = parseArgs(process.argv.slice(2))._, userIsPipingInput = isUserPipingInput())

Source from the content-addressed store, hash-verified

17class SimpleCLI {
18 CommandFnDecoratorSuffix = "Command"
19 async executeUsersInstructionsFromShell(args = parseArgs(process.argv.slice(2))._, userIsPipingInput = isUserPipingInput()) {
20 const command = args[0]
21 const commandName = `${command}${this.CommandFnDecoratorSuffix}`
22 if (this[commandName]) return userIsPipingInput ? this._runCommandOnPipedStdIn(commandName) : this[commandName](process.cwd(), args.slice(1))
23 else if (command) this.log(`No command '${command}'. Running help command.`)
24 else this.log(`No command provided. Running help command.`)
25 return this.helpCommand()
26 }
27
28 _runCommandOnPipedStdIn(commandName) {
29 this.log(`Running ${commandName} on piped input`)

Callers 3

cli.jsFile · 0.80
scroll.jsFile · 0.80
scroll.test.jsFile · 0.80

Calls 5

logMethod · 0.95
helpCommandMethod · 0.95
isUserPipingInputFunction · 0.85
sliceMethod · 0.80

Tested by

no test coverage detected