aboutsummaryrefslogtreecommitdiffstats
path: root/misc/auto-completion/bash
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-05-18 09:05:19 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-05-18 09:05:19 +0530
commit1b5c3096caaa6cd903473a69ec0890f40a986967 (patch)
treeb1f04dd8a77dc6963bfb430f8e0ec769995b0b82 /misc/auto-completion/bash
parentcafcf1c4859c7a43eed0e2489142166195078d5d (diff)
downloadnnn-1b5c3096caaa6cd903473a69ec0890f40a986967.tar.gz
Option -P: specify plugin key to run on start
Diffstat (limited to 'misc/auto-completion/bash')
-rw-r--r--misc/auto-completion/bash/nnn-completion.bash4
1 files changed, 4 insertions, 0 deletions
diff --git a/misc/auto-completion/bash/nnn-completion.bash b/misc/auto-completion/bash/nnn-completion.bash
index eeb1156..e8f2548 100644
--- a/misc/auto-completion/bash/nnn-completion.bash
+++ b/misc/auto-completion/bash/nnn-completion.bash
@@ -27,6 +27,7 @@ _nnn ()
-n
-o
-p
+ -P
-Q
-r
-R
@@ -45,6 +46,9 @@ _nnn ()
return 1
elif [[ $prev == -p ]]; then
COMPREPLY=( $(compgen -f -d -- "$cur") )
+ elif [[ $prev == -P ]]; then
+ local plugins=$(echo $NNN_PLUG | awk -F: -v RS=\; '{print $1}')
+ COMPREPLY=( $(compgen -W "$plugins" -- "$cur") )
elif [[ $prev == -s ]]; then
local sessions_dir=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/sessions
COMPREPLY=( $(cd "$sessions_dir" && compgen -f -d -- "$cur") )