__get_all_users () { loginctl --no-legend list-users | { while read -r a b; do printf "%s\n" "$b"; done; } ; }
__get_all_seats () { loginctl --no-legend list-seats | { while read -r a b; do printf "%s\n" "$a"; done; } ; }
+__get_machines() {
+ local a b
+ machinectl list --no-legend --no-pager 2>/dev/null |
+ { while read a b; do echo " $a"; done; };
+}
+
_loginctl () {
local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
local i verb comps
--host|-H)
comps=$(compgen -A hostname)
;;
+ --machine|-M)
+ comps=$( __get_machines )
+ ;;
--property|-p)
comps=''
;;