diff --git a/cmd/lncli/commands.go b/cmd/lncli/commands.go index 60cbd077e..e38479536 100644 --- a/cmd/lncli/commands.go +++ b/cmd/lncli/commands.go @@ -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", diff --git a/cmd/lncli/main.go b/cmd/lncli/main.go index 6aa591879..d65568dab 100644 --- a/cmd/lncli/main.go +++ b/cmd/lncli/main.go @@ -390,6 +390,7 @@ func main() { deletePaymentsCommand, sendCustomCommand, subscribeCustomCommand, + fishCompletionCommand, } // Add any extra commands determined by build flags. diff --git a/docs/INSTALL.md b/docs/INSTALL.md index 47ed8f445..7ee331e69 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -1,25 +1,26 @@ # Table of Contents -* [Installation](#installation) - * [Installing a binary release](#installing-a-binary-release) - * [Building a tagged version with Docker](#building-a-tagged-version-with-docker) - * [Building a development version from source](#building-a-development-version-from-source) - * [Preliminaries](#preliminaries-for-installing-from-source) - * [Installing lnd](#installing-lnd-from-source) -* [Available Backend Operating Modes](#available-backend-operating-modes) - * [btcd Options](#btcd-options) - * [Neutrino Options](#neutrino-options) - * [Bitcoind Options](#bitcoind-options) - * [Using btcd](#using-btcd) - * [Installing btcd](#installing-btcd) - * [Starting btcd](#starting-btcd) - * [Running lnd using the btcd backend](#running-lnd-using-the-btcd-backend) - * [Using Neutrino](#using-neutrino) - * [Using bitcoind or litecoind](#using-bitcoind-or-litecoind) -* [Creating a Wallet](#creating-a-wallet) -* [Macaroons](#macaroons) -* [Network Reachability](#network-reachability) -* [Simnet vs. Testnet Development](#simnet-vs-testnet-development) -* [Creating an lnd.conf (Optional)](#creating-an-lndconf-optional) +- [Table of Contents](#table-of-contents) +- [Installation](#installation) + - [Installing a binary release](#installing-a-binary-release) + - [Building a tagged version with Docker](#building-a-tagged-version-with-docker) + - [Building a development version from source](#building-a-development-version-from-source) + - [Preliminaries for installing from source](#preliminaries-for-installing-from-source) + - [Installing lnd from source](#installing-lnd-from-source) +- [Available Backend Operating Modes](#available-backend-operating-modes) + - [btcd Options](#btcd-options) + - [Neutrino Options](#neutrino-options) + - [Bitcoind Options](#bitcoind-options) + - [Using btcd](#using-btcd) + - [Installing btcd](#installing-btcd) + - [Starting btcd](#starting-btcd) + - [Running lnd using the btcd backend](#running-lnd-using-the-btcd-backend) + - [Using Neutrino](#using-neutrino) + - [Using bitcoind or litecoind](#using-bitcoind-or-litecoind) +- [Creating a wallet](#creating-a-wallet) +- [Macaroons](#macaroons) +- [Network Reachability](#network-reachability) +- [Simnet vs. Testnet Development](#simnet-vs-testnet-development) +- [Creating an lnd.conf (Optional)](#creating-an-lndconf-optional) # Installation @@ -241,6 +242,11 @@ To check that `lnd` was installed properly run the following command: This command requires `bitcoind` (almost any version should do) to be available in the system's `$PATH` variable. Otherwise some of the tests will fail. +**Command-line completion for `lncli`** + +_Bash_: See `contrib/lncli.bash-completion` +_Fish_: Run: `lncli fish-completion > $HOME/.config/fish/completions/lncli.fish` + # Available Backend Operating Modes In order to run, `lnd` requires, that the user specify a chain backend. At the