|
|
@ -61,13 +61,17 @@ function _miaou_exec() { |
|
|
|
|
|
|
|
|
if ((COMP_CWORD == 3)); then |
|
|
if ((COMP_CWORD == 3)); then |
|
|
# command or file from inside container |
|
|
# command or file from inside container |
|
|
|
|
|
|
|
|
|
|
|
# echo -e "\nCOMMAND or FILE from CONTAINER\n" >&2 |
|
|
COMPREPLY=($( |
|
|
COMPREPLY=($( |
|
|
incus exec "$container" -- bash << EOF |
|
|
incus exec "$container" -- bash << EOF |
|
|
source /etc/bash_completion |
|
|
|
|
|
compgen -c -- "$cur" |
|
|
|
|
|
|
|
|
bind -f /etc/inputrc 2>/dev/null |
|
|
|
|
|
source /etc/bash_completion |
|
|
|
|
|
compgen -c -- "$cur" |
|
|
|
|
|
compgen -f -- "$cur" |
|
|
EOF |
|
|
EOF |
|
|
)) |
|
|
)) |
|
|
|
|
|
compopt -o filenames |
|
|
|
|
|
compopt -o nospace |
|
|
return |
|
|
return |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
@ -94,19 +98,20 @@ EOF |
|
|
# echo -e "\ncompletion_command $completion_command \nprev=$prev \ncur=$cur \nCOMP_WORDS=(${COMP_WORDS[@]}) \nCOMP_CWORD=$COMP_CWORD \nCOMP_LINE=$COMP_LINE \nCOMP_POINT=$COMP_POINT" >&2 |
|
|
# echo -e "\ncompletion_command $completion_command \nprev=$prev \ncur=$cur \nCOMP_WORDS=(${COMP_WORDS[@]}) \nCOMP_CWORD=$COMP_CWORD \nCOMP_LINE=$COMP_LINE \nCOMP_POINT=$COMP_POINT" >&2 |
|
|
COMPREPLY=($( |
|
|
COMPREPLY=($( |
|
|
incus exec "$container" -- bash << EOF |
|
|
incus exec "$container" -- bash << EOF |
|
|
source /etc/bash_completion |
|
|
|
|
|
for i in /etc/bash_completion.d/*; do source \$i; done |
|
|
|
|
|
source /usr/share/bash-completion/bash_completion |
|
|
|
|
|
[[ -f /usr/share/bash-completion/completions/$command ]] && source /usr/share/bash-completion/completions/$command |
|
|
|
|
|
COMP_WORDS=(${COMP_WORDS[@]}) |
|
|
|
|
|
COMP_CWORD=$COMP_CWORD |
|
|
|
|
|
COMP_LINE="$COMP_LINE" |
|
|
|
|
|
COMP_POINT=$COMP_POINT |
|
|
|
|
|
COMP_TYPE=9 |
|
|
|
|
|
COMP_KEY=9 |
|
|
|
|
|
export COMP_WORDS COMP_CWORD COMP_LINE COMP_POINT COMP_TYPE COMP_KEY |
|
|
|
|
|
$completion_command 2>/dev/null |
|
|
|
|
|
echo \${COMPREPLY[@]} |
|
|
|
|
|
|
|
|
bind -f /etc/inputrc 2>/dev/null |
|
|
|
|
|
source /etc/bash_completion |
|
|
|
|
|
for i in /etc/bash_completion.d/*; do source \$i; done |
|
|
|
|
|
source /usr/share/bash-completion/bash_completion |
|
|
|
|
|
[[ -f /usr/share/bash-completion/completions/$command ]] && source /usr/share/bash-completion/completions/$command |
|
|
|
|
|
COMP_WORDS=(${COMP_WORDS[@]}) |
|
|
|
|
|
COMP_CWORD=$COMP_CWORD |
|
|
|
|
|
COMP_LINE="$COMP_LINE" |
|
|
|
|
|
COMP_POINT=$COMP_POINT |
|
|
|
|
|
COMP_TYPE=9 |
|
|
|
|
|
COMP_KEY=9 |
|
|
|
|
|
export COMP_WORDS COMP_CWORD COMP_LINE COMP_POINT COMP_TYPE COMP_KEY |
|
|
|
|
|
$completion_command 2>/dev/null |
|
|
|
|
|
echo \${COMPREPLY[@]} |
|
|
EOF |
|
|
EOF |
|
|
)) |
|
|
)) |
|
|
if [[ $completion_command == '_comp_complete_longopt' ]]; then |
|
|
if [[ $completion_command == '_comp_complete_longopt' ]]; then |
|
|
@ -115,12 +120,14 @@ EOF |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
else |
|
|
else |
|
|
|
|
|
echo -e "\nNO completion_command JUST plain files and firs" >&2 |
|
|
compopt -o filenames |
|
|
compopt -o filenames |
|
|
compopt -o nospace |
|
|
compopt -o nospace |
|
|
COMPREPLY=($( |
|
|
COMPREPLY=($( |
|
|
incus exec "$container" -- bash << EOF |
|
|
incus exec "$container" -- bash << EOF |
|
|
source /etc/bash_completion |
|
|
|
|
|
compgen -f "$cur" 2>/dev/null |
|
|
|
|
|
|
|
|
bind -f /etc/inputrc 2>/dev/null |
|
|
|
|
|
source /etc/bash_completion |
|
|
|
|
|
compgen -f "$cur" 2>/dev/null |
|
|
EOF |
|
|
EOF |
|
|
)) |
|
|
)) |
|
|
fi |
|
|
fi |
|
|
|