MCPcopy Index your code
hub / github.com/Effect-TS/effect / splitExecutable

Function splitExecutable

packages/cli/src/internal/cliApp.ts:136–145  ·  view source on GitHub ↗
(self: CliApp.CliApp<A>, args: ReadonlyArray<string>)

Source from the content-addressed store, hash-verified

134// =============================================================================
135
136const splitExecutable = <A>(self: CliApp.CliApp<A>, args: ReadonlyArray<string>): [
137 executable: string,
138 args: ReadonlyArray<string>
139] => {
140 if (self.executable !== undefined) {
141 return [self.executable, Arr.drop(args, 2)]
142 }
143 const [[runtime, script], optionsAndArgs] = Arr.splitAt(args, 2)
144 return [`${runtime} ${script}`, optionsAndArgs]
145}
146
147const printDocs = (error: HelpDoc.HelpDoc): Effect.Effect<void> => Console.error(InternalHelpDoc.toAnsiText(error))
148

Callers 1

cliApp.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected