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

Function getHelp

packages/cli/src/internal/usage.ts:72–89  ·  view source on GitHub ↗
(self: Usage.Usage)

Source from the content-addressed store, hash-verified

70
71/** @internal */
72export const getHelp = (self: Usage.Usage): HelpDoc.HelpDoc => {
73 const spans = enumerate(self, InternalCliConfig.defaultConfig)
74 if (Arr.isNonEmptyReadonlyArray(spans)) {
75 const head = Arr.headNonEmpty(spans)
76 const tail = Arr.tailNonEmpty(spans)
77 if (Arr.isNonEmptyReadonlyArray(tail)) {
78 return pipe(
79 Arr.map(spans, (span) => InternalHelpDoc.p(span)),
80 Arr.reduceRight(
81 InternalHelpDoc.empty,
82 (left, right) => InternalHelpDoc.sequence(left, right)
83 )
84 )
85 }
86 return InternalHelpDoc.p(head)
87 }
88 return InternalHelpDoc.empty
89}
90
91/** @internal */
92export const enumerate = dual<

Callers

nothing calls this directly

Calls 2

pipeFunction · 0.70
mapMethod · 0.65

Tested by

no test coverage detected