From cf8fa4a1c9dcae5ac1ae48e8dcf9ed194cbf02a2 Mon Sep 17 00:00:00 2001 From: Remko Popma Date: Mon, 23 Jul 2018 06:34:12 +0900 Subject: [PATCH] #418 Improve autocompletion script installation instructions Closes #418 --- src/main/java/picocli/AutoComplete.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/picocli/AutoComplete.java b/src/main/java/picocli/AutoComplete.java index dd630ad5a..78d74df47 100644 --- a/src/main/java/picocli/AutoComplete.java +++ b/src/main/java/picocli/AutoComplete.java @@ -228,14 +228,20 @@ public boolean equals(Object obj) { "# Installation\n" + "# ------------\n" + "#\n" + - "# 1. Place this file in a `bash-completion.d` folder:\n" + + "# 1. Source all completion scripts in your .bash_profile\n" + + "#\n" + + "# cd $YOUR_APP_HOME/bin\n" + + "# for f in $(find . -name \"*_completion\"); do line=\". $(pwd)/$f\"; grep \"$line\" ~/.bash_profile || echo \"$line\" >> ~/.bash_profile; done\n" + + "#\n" + + "# 2. Open a new bash console, and type `%1$s [TAB][TAB]`\n" + + "#\n" + + "# 1a. Alternatively, if you have [bash-completion](https://github.com/scop/bash-completion) installed:\n" + + "# Place this file in a `bash-completion.d` folder:\n" + "#\n" + "# * /etc/bash-completion.d\n" + "# * /usr/local/etc/bash-completion.d\n" + "# * ~/bash-completion.d\n" + "#\n" + - "# 2. Open a new bash console, and type `%1$s [TAB][TAB]`\n" + - "#\n" + "# Documentation\n" + "# -------------\n" + "# The script is called by bash whenever [TAB] or [TAB][TAB] is pressed after\n" +