mirror of
https://github.com/containers/podman.git
synced 2025-08-06 11:32:07 +08:00
Merge pull request #6442 from Luap99/podman-autocomplete
Shell completion
This commit is contained in:
@ -25,6 +25,12 @@ function podman_commands() {
|
||||
$PODMAN help "$@" |\
|
||||
awk '/^Available Commands:/{ok=1;next}/^Options:/{ok=0}ok { print $1 }' |\
|
||||
grep .
|
||||
|
||||
# Special case: podman-completion is a hidden command
|
||||
# it does not show in podman help so add it here
|
||||
if [[ -z "$@" ]]; then
|
||||
echo "completion"
|
||||
fi
|
||||
}
|
||||
|
||||
# Read a list of subcommands from a command's metadoc
|
||||
|
@ -181,6 +181,9 @@ sub xref_by_man {
|
||||
next if $k eq 'varlink';
|
||||
next if "@subcommand" eq 'system' && $k eq 'service';
|
||||
|
||||
# Special case: podman completion is a hidden command
|
||||
next if $k eq 'completion';
|
||||
|
||||
warn "$ME: podman @subcommand: $k in $man, but not --help\n";
|
||||
++$Errs;
|
||||
}
|
||||
|
Reference in New Issue
Block a user