blob: 401a9e232d32d73c7e691a8c01423ecc77d784aa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
package askcli
import (
"context"
"fmt"
"io"
"os"
)
func (d *Dispatcher) handleFish(ctx context.Context, args []string, stdout, stderr io.Writer) (int, error) {
_ = ctx
if len(args) != 1 {
fmt.Fprintln(stderr, "usage: do fish")
return 1, nil
}
binaryPath, err := os.Executable()
if err != nil {
binaryPath = "do"
}
if _, err := io.WriteString(stdout, FishCompletionFor(binaryPath)); err != nil {
return 1, err
}
return 0, nil
}
|