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

Function getFishCompletions

packages/cli/src/internal/primitive.ts:669–714  ·  view source on GitHub ↗
(self: Instruction)

Source from the content-addressed store, hash-verified

667
668/** @internal */
669export const getFishCompletions = (self: Instruction): Array<string> => {
670 switch (self._tag) {
671 case "Bool": {
672 return Arr.empty()
673 }
674 case "DateTime":
675 case "Float":
676 case "Integer":
677 case "Redacted":
678 case "Secret":
679 case "Text": {
680 return Arr.make("-r", "-f")
681 }
682 case "Path": {
683 switch (self.pathType) {
684 case "file": {
685 return self.pathExists === "yes" || self.pathExists === "either"
686 ? Arr.make("-r", "-F")
687 : Arr.make("-r")
688 }
689 case "directory": {
690 return self.pathExists === "yes" || self.pathExists === "either"
691 ? Arr.make(
692 "-r",
693 "-f",
694 "-a",
695 `"(__fish_complete_directories (commandline -ct))"`
696 )
697 : Arr.make("-r")
698 }
699 case "either": {
700 return self.pathExists === "yes" || self.pathExists === "either"
701 ? Arr.make("-r", "-F")
702 : Arr.make("-r")
703 }
704 }
705 }
706 case "Choice": {
707 const choices = pipe(
708 Arr.map(self.alternatives, ([choice]) => `${choice}''`),
709 Arr.join(",")
710 )
711 return Arr.make("-r", "-f", "-a", `"{${choices}}"`)
712 }
713 }
714}
715
716/** @internal */
717export const getZshCompletions = (self: Instruction): string => {

Callers

nothing calls this directly

Calls 4

pipeFunction · 0.70
makeMethod · 0.65
mapMethod · 0.65
joinMethod · 0.65

Tested by

no test coverage detected