|
|
|
@ -62,16 +62,30 @@ function _miaou_exec() { |
|
|
|
if ((COMP_CWORD == 3)); then |
|
|
|
# command or file from inside container |
|
|
|
# echo -e "\nCOMMAND or FILE from CONTAINER\n" >&2 |
|
|
|
COMPREPLY=($( |
|
|
|
|
|
|
|
COMPREPLY_COMMANDS=($( |
|
|
|
incus exec "$container" -- bash << EOF |
|
|
|
bind -f /etc/inputrc 2>/dev/null |
|
|
|
source /etc/bash_completion |
|
|
|
compgen -c -- "$cur" |
|
|
|
EOF |
|
|
|
)) |
|
|
|
COMPREPLY_FILES=($( |
|
|
|
incus exec "$container" -- bash << EOF |
|
|
|
bind -f /etc/inputrc 2>/dev/null |
|
|
|
source /etc/bash_completion |
|
|
|
compgen -f -- "$cur" |
|
|
|
EOF |
|
|
|
)) |
|
|
|
|
|
|
|
COMPREPLY=(${COMPREPLY_COMMANDS[@]} ${COMPREPLY_FILES[@]}) |
|
|
|
if [[ ${#COMPREPLY_FILES[@]} -gt 0 ]]; then |
|
|
|
compopt -o filenames |
|
|
|
compopt -o nospace |
|
|
|
fi |
|
|
|
|
|
|
|
# echo -e "\nCOMPREPLY=( ${COMPREPLY[@]} ) FILES=${#COMPREPLY_FILES[@]}\n" >&2 |
|
|
|
|
|
|
|
return |
|
|
|
fi |
|
|
|
|
|
|
|
|