1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-08 21:17:47 +03:00

shell-completion/zsh: rename helper for clarity

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2022-10-20 09:45:24 +02:00
parent 4e9183059a
commit 9e7cc6f0d2

View File

@ -1,15 +1,15 @@
#compdef machinectl #compdef machinectl
# SPDX-License-Identifier: LGPL-2.1-or-later # SPDX-License-Identifier: LGPL-2.1-or-later
(( $+functions[__machinectl_get_machines] )) || (( $+functions[__machinectl_get_images] )) ||
__machinectl_get_machines () { __machinectl_get_images () {
machinectl --no-legend list-images | {while read -r a b; do echo $a; done;} machinectl --no-legend list-images | {while read -r a b; do echo $a; done;}
} }
(( $+functions[_machinectl_machines] )) || (( $+functions[_machinectl_images] )) ||
_machinectl_machines() { _machinectl_images() {
local -a _machines local -a _machines
_machines=("${(fo)$(__machinectl_get_machines)}") _machines=("${(fo)$(__machinectl_get_images)}")
typeset -U _machines typeset -U _machines
if [[ -n "$_machines" ]]; then if [[ -n "$_machines" ]]; then
_describe 'machines' _machines _describe 'machines' _machines
@ -64,9 +64,9 @@
list*|cancel-transfer|pull-tar|pull-raw) list*|cancel-transfer|pull-tar|pull-raw)
msg="no options" ;; msg="no options" ;;
clone) clone)
_machinectl_machines ;; _machinectl_images ;;
start) start)
_machinectl_machines ;; _machinectl_images ;;
*) *)
_sd_machines _sd_machines
esac esac