author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Sun, 10 Dec 2023 19:17:02 +0200 | |
changeset 1033 | 8d13ffe12bd6 |
parent 1032 | 9cf008356bdf |
permissions | -rw-r--r-- |
1032
9cf008356bdf
Dynamically build completion for podman.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
1 |
eval "$(podman completion bash)" |
9cf008356bdf
Dynamically build completion for podman.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
2 |
|
9cf008356bdf
Dynamically build completion for podman.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
3 |
# Strips .exe for Cygwin with BASHOPTS=completion_strip_exe. |
9cf008356bdf
Dynamically build completion for podman.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
4 |
__podman_win_fix() { |
9cf008356bdf
Dynamically build completion for podman.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
5 |
local -a cmd=( $(complete -p podman.exe) ) |
9cf008356bdf
Dynamically build completion for podman.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
6 |
[[ $? = 0 ]] || return |
9cf008356bdf
Dynamically build completion for podman.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
7 |
cmd[-1]=podman |
9cf008356bdf
Dynamically build completion for podman.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
8 |
eval "${cmd[@]}" |
9cf008356bdf
Dynamically build completion for podman.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
9 |
} |
9cf008356bdf
Dynamically build completion for podman.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
10 |
__podman_win_fix |
1033
8d13ffe12bd6
Cleanup function after the usage.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1032
diff
changeset
|
11 |
unset -f __podman_win_fix |