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

Function getFishCompletions

packages/cli/src/internal/args.ts:1033–1066  ·  view source on GitHub ↗
(self: Instruction)

Source from the content-addressed store, hash-verified

1031
1032/** @internal */
1033export const getFishCompletions = (self: Instruction): Array<string> => {
1034 switch (self._tag) {
1035 case "Empty": {
1036 return Arr.empty()
1037 }
1038 case "Single": {
1039 const description = getShortDescription(self)
1040 return pipe(
1041 InternalPrimitive.getFishCompletions(
1042 self.primitiveType as InternalPrimitive.Instruction
1043 ),
1044 Arr.appendAll(
1045 description.length === 0
1046 ? Arr.empty()
1047 : Arr.of(`-d '${description}'`)
1048 ),
1049 Arr.join(" "),
1050 Arr.of
1051 )
1052 }
1053 case "Both": {
1054 return pipe(
1055 getFishCompletions(self.left as Instruction),
1056 Arr.appendAll(getFishCompletions(self.right as Instruction))
1057 )
1058 }
1059 case "Map":
1060 case "Variadic":
1061 case "WithDefault":
1062 case "WithFallbackConfig": {
1063 return getFishCompletions(self.args as Instruction)
1064 }
1065 }
1066}
1067
1068interface ZshCompletionState {
1069 readonly multiple: boolean

Callers

nothing calls this directly

Calls 4

getShortDescriptionFunction · 0.70
pipeFunction · 0.70
ofMethod · 0.65
joinMethod · 0.65

Tested by

no test coverage detected