blob: 3d3e709e81a62b0441eaba20ae6606d70762b4e9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
}
|