| 715 | |
| 716 | /** @internal */ |
| 717 | export const getZshCompletions = (self: Instruction): string => { |
| 718 | switch (self._tag) { |
| 719 | case "Bool": { |
| 720 | return "" |
| 721 | } |
| 722 | case "Choice": { |
| 723 | const choices = pipe( |
| 724 | Arr.map(self.alternatives, ([name]) => name), |
| 725 | Arr.join(" ") |
| 726 | ) |
| 727 | return `:CHOICE:(${choices})` |
| 728 | } |
| 729 | case "DateTime": { |
| 730 | return "" |
| 731 | } |
| 732 | case "Float": { |
| 733 | return "" |
| 734 | } |
| 735 | case "Integer": { |
| 736 | return "" |
| 737 | } |
| 738 | case "Path": { |
| 739 | switch (self.pathType) { |
| 740 | case "file": { |
| 741 | return self.pathExists === "yes" || self.pathExists === "either" |
| 742 | ? ":PATH:_files" |
| 743 | : "" |
| 744 | } |
| 745 | case "directory": { |
| 746 | return self.pathExists === "yes" || self.pathExists === "either" |
| 747 | ? ":PATH:_files -/" |
| 748 | : "" |
| 749 | } |
| 750 | case "either": { |
| 751 | return self.pathExists === "yes" || self.pathExists === "either" |
| 752 | ? ":PATH:_files" |
| 753 | : "" |
| 754 | } |
| 755 | } |
| 756 | } |
| 757 | case "Redacted": |
| 758 | case "Secret": |
| 759 | case "Text": { |
| 760 | return "" |
| 761 | } |
| 762 | } |
| 763 | } |