MCPcopy Create free account
hub / github.com/Effect-TS/effect / renderCommandBlock

Function renderCommandBlock

packages/effect/src/unstable/cli/internal/wizard.ts:244–256  ·  view source on GitHub ↗
(
  label: string,
  commandLine: ReadonlyArray<string>,
  commandColor: string,
  labelColor: string = Ansi.white
)

Source from the content-addressed store, hash-verified

242export const renderQuit = (): string => `\n${Ansi.annotate("Wizard cancelled.", Ansi.red)}`
243
244const renderCommandBlock = (
245 label: string,
246 commandLine: ReadonlyArray<string>,
247 commandColor: string,
248 labelColor: string = Ansi.white
249): string => {
250 const lines = wrapCommand(commandLine)
251 return [
252 Ansi.annotate(label, Ansi.bold, labelColor),
253 ...lines.map((line) => Ansi.annotate(line, commandColor)),
254 ""
255 ].join("\n")
256}
257
258const wrapCommand = (commandLine: ReadonlyArray<string>): Array<string> => {
259 const width = 88

Callers 2

logCurrentCommandFunction · 0.85
renderCompletionFunction · 0.85

Calls 4

wrapCommandFunction · 0.85
joinMethod · 0.80
annotateMethod · 0.65
mapMethod · 0.45

Tested by

no test coverage detected