From 9bc70d5b638d70f4d09da415423745cd2dc1e8b2 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sat, 20 Jan 2024 13:59:38 +0700 Subject: completions: enable completion on first parameter in local and play The first parameter of "local" and "play" command is the path to file to execute. --- _sys/usr/share/bash-completion/completions/awwan | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/_sys/usr/share/bash-completion/completions/awwan b/_sys/usr/share/bash-completion/completions/awwan index fd805a3..4337b7f 100644 --- a/_sys/usr/share/bash-completion/completions/awwan +++ b/_sys/usr/share/bash-completion/completions/awwan @@ -47,10 +47,18 @@ _awwan_completions() help) ;; local) - COMPREPLY=($(compgen -A file -X "?(*.log|.*)" -- "$key")) + case $COMP_CWORD in + 2) + COMPREPLY=($(compgen -A file -X "?(*.log|.*)" -- "$key")) + ;; + esac ;; play) - COMPREPLY=($(compgen -A file -X "?(*.log|.*)" -- "$key")) + case $COMP_CWORD in + 2) + COMPREPLY=($(compgen -A file -X "?(*.log|.*)" -- "$key")) + ;; + esac ;; serve) COMPREPLY=($(compgen -A directory -- "$key")) -- cgit v1.3