Skip to content

Commit d2482cf

Browse files
authored
Add generate-fish-completion (#1006)
1 parent 722b7b2 commit d2482cf

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/cli/cli.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,19 @@ func Run() (err error) {
9696
&cli.IntFlag{Name: "transfers", Value: 5, Usage: "number of ports to use for relay"},
9797
},
9898
},
99+
{
100+
Name: "generate-fish-completion",
101+
Usage: "generate fish completion and output to stdout",
102+
Hidden: true,
103+
Action: func(ctx *cli.Context) error {
104+
completion, err := ctx.App.ToFishCompletion()
105+
if err != nil {
106+
return err
107+
}
108+
fmt.Print(completion)
109+
return nil
110+
},
111+
},
99112
}
100113
app.Flags = []cli.Flag{
101114
&cli.BoolFlag{Name: "internal-dns", Usage: "use a built-in DNS stub resolver rather than the host operating system"},

0 commit comments

Comments
 (0)