From 34a8b004d2b73ac94b7ed2ac2a9b1d5d8d93675b Mon Sep 17 00:00:00 2001 From: Antoine Eiche Date: Thu, 21 Jul 2016 21:11:47 +0200 Subject: [PATCH] Documentation regarding the init-completion flag --- README.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1b29c86..a564c22 100644 --- a/README.md +++ b/README.md @@ -794,10 +794,18 @@ func main() { #### Enabling -Source the `autocomplete/bash_autocomplete` file in your `.bashrc` file while -setting the `PROG` variable to the name of your program: +You can generate bash or zsh completion code by using the flag `--init-completion bash` or `--init-completion bash`. -`PROG=myprogram source /.../cli/autocomplete/bash_autocomplete` +To setup for bash: + +``` +eval "`myprogram --init-completion bash`" +``` + +Alternatively, you can put the completion code in your `.bashrc` file: +``` +myprogram --init-completion bash >> ~/.bashrc +``` #### Distribution