lncli: add fish-completion
This is a new, hidden command that generates completions for Fish shell. This can be piped into `source` or saved in a file to activate (almost) perfect tab completion.
This commit is contained in:
1 parent
c64e9c5286
commit
55617f153f
3 files changed
+44
-21
No files matched your search
@@ -2127,6 +2127,22 @@ func updateChannelPolicy(ctx *cli.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
var fishCompletionCommand = cli.Command{
|
||||
Name: "fish-completion",
|
||||
Hidden: true,
|
||||
Action: func(c *cli.Context) error {
|
||||
completion, err := c.App.ToFishCompletion()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// We don't want to suggest files, so we add this
|
||||
// first line to the completions.
|
||||
_, err = fmt.Printf("complete -c %q -f \n%s", c.App.Name, completion)
|
||||
return err
|
||||
},
|
||||
}
|
||||
|
||||
var exportChanBackupCommand = cli.Command{
|
||||
Name: "exportchanbackup",
|
||||
Category: "Channels",
|
||||
|
||||
@@ -390,6 +390,7 @@ func main() {
|
||||
deletePaymentsCommand,
|
||||
sendCustomCommand,
|
||||
subscribeCustomCommand,
|
||||
fishCompletionCommand,
|
||||
}
|
||||
|
||||
// Add any extra commands determined by build flags.
|
||||
|
||||
Reference in new issue
Block a user