diff options
Diffstat (limited to 'internal/askcli/command_fish.go')
| -rw-r--r-- | internal/askcli/command_fish.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/internal/askcli/command_fish.go b/internal/askcli/command_fish.go new file mode 100644 index 0000000..89a8457 --- /dev/null +++ b/internal/askcli/command_fish.go @@ -0,0 +1,22 @@ +package askcli + +import ( + "fmt" + "io" + "os" +) + +func (d Dispatcher) handleFish(args []string, stdout, stderr io.Writer) (int, error) { + if len(args) != 1 { + fmt.Fprintln(stderr, "usage: ask fish") + return 1, nil + } + binaryPath, err := os.Executable() + if err != nil { + binaryPath = "ask" + } + if _, err := io.WriteString(stdout, FishCompletionFor(binaryPath)); err != nil { + return 1, err + } + return 0, nil +} |
