File tree Expand file tree Collapse file tree 2 files changed +30
-4
lines changed Expand file tree Collapse file tree 2 files changed +30
-4
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,32 @@ To execute a Loop In:
6464loop in <amt_in_satoshis>
6565```
6666
67+ ### Bash completion
68+
69+ To enable command line auto-completion for ` loop ` command, do this:
70+
71+ ```
72+ $ mkdir -p ~/.local/share/bash-completion/completions/
73+ $ loop completion bash > ~/.local/share/bash-completion/completions/loop
74+ $ . ~/.local/share/bash-completion/completions/loop
75+ $ echo '. ~/.local/share/bash-completion/completions/loop' >> ~/.bashrc
76+ ```
77+
78+ It will complete commands and flags if you type ` loop ` and press TAB:
79+ ```
80+ $ loop static <TAB>
81+ help listswaps new
82+ in listunspent summary
83+ listdeposits listwithdrawals withdraw
84+
85+ $ loop static in --<TAB>
86+ --all --label --payment_timeout --utxo
87+ --amount --last_hop --route_hints
88+ ```
89+
90+ It also supports zsh, fish, and powershell. Just replace "bash" with your shell
91+ name in the command above and ajust the completion file location.
92+
6793### More info
6894For more information about using Loop checkout our [ Loop FAQs] ( ./docs/faqs.md ) .
6995
Original file line number Diff line number Diff line change 9494)
9595
9696const (
97-
9897 // satAmtFmt formats a satoshi value into a one line string, intended to
9998 // prettify the terminal output. For Instance,
10099 // fmt.Printf(f, "Estimated on-chain fee:", fee)
@@ -163,9 +162,10 @@ func fatal(err error) {
163162
164163func main () {
165164 rootCmd := & cli.Command {
166- Name : "loop" ,
167- Usage : "control plane for your loopd" ,
168- Version : loop .RichVersion (),
165+ Name : "loop" ,
166+ Usage : "control plane for your loopd" ,
167+ Version : loop .RichVersion (),
168+ EnableShellCompletion : true ,
169169 Flags : []cli.Flag {
170170 & cli.StringFlag {
171171 Name : "rpcserver" ,
You can’t perform that action at this time.
0 commit comments