# systemd-run(1) completion                       -*- shell-script -*-
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# systemd is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.

__systemctl() {
    local mode=$1; shift 1
    systemctl $mode --full --no-legend --no-pager --plain "$@"
}

__get_slice_units () { __systemctl $1 list-units --all -t slice \
                           | { while read -r a b c d; do echo " $a"; done; }; }

__get_machines() {
    local a b
    machinectl list --full --no-legend --no-pager | { while read a b; do echo " $a"; done; };
}

_systemd_run() {
    local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
    local OPTS='--no-ask-password --scope -u --unit -p --property --description --slice --slice-inherit
                -r --remain-after-exit --send-sighup --service-type --uid --gid --nice
                --working-directory -d --same-dir -E --setenv -t --pty -P --pipe -S --shell -q --quiet
                --on-active --on-boot --on-startup --on-unit-active --on-unit-inactive --on-calendar
                --on-clock-change --on-timezone-change --path-property --socket-property
                --timer-property --no-block --wait -G --collect --user --system -H --host -M --machine
                -h --help --version'

    local mode=--system
    local i
    local opts_with_values=(
        --unit -p --property --slice --description --service-type --uid --gid --nice --working-directory
        -E --setenv --on-active --on-boot --on-startup --on-unit-active --on-unit-inactive --on-calendar
        --path-property --socket-property --timer-property -H --host -M --machine
    )
    for (( i=1; i <= COMP_CWORD; i++ )); do
        if [[ ${COMP_WORDS[i]} != -* ]]; then
            local root_command=${COMP_WORDS[i]}
            _command_offset $i
            return
        fi

        [[ ${COMP_WORDS[i]} == "--user" ]] && mode=--user

        [[ $i -lt $COMP_CWORD && " ${opts_with_values[@]} " =~ " ${COMP_WORDS[i]} " ]] && ((i++))
    done

    case "$prev" in
        --unit|--description|--on-active|--on-boot|--on-startup|--on-unit-active|--on-unit-inactive|--on-calendar)
            # argument required but no completions available
            return
            ;;
        --slice)
            local comps=$(__get_slice_units $mode)

            COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
            return 0
            ;;
        --service-type)
            local comps='simple forking oneshot dbus notify idle'

            COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
            return 0
            ;;
        -p|--property)
            local comps='CPUAccounting= MemoryAccounting= BlockIOAccounting= SendSIGHUP=
                         SendSIGKILL= MemoryLimit= CPUShares= BlockIOWeight= User= Group=
                         DevicePolicy= KillMode= DeviceAllow= BlockIOReadBandwidth=
                         BlockIOWriteBandwidth= BlockIODeviceWeight= Nice= Environment=
                         KillSignal= RestartKillSignal= FinalKillSignal= LimitCPU= LimitFSIZE= LimitDATA=
                         LimitSTACK= LimitCORE= LimitRSS= LimitNOFILE= LimitAS= LimitNPROC=
                         LimitMEMLOCK= LimitLOCKS= LimitSIGPENDING= LimitMSGQUEUE=
                         LimitNICE= LimitRTPRIO= LimitRTTIME= PrivateTmp= PrivateDevices=
                         PrivateNetwork= NoNewPrivileges= WorkingDirectory= RootDirectory=
                         TTYPath= SyslogIdentifier= SyslogLevelPrefix= SyslogLevel=
                         SyslogFacility= TimerSlackNSec= OOMScoreAdjust= ReadWritePaths=
                         ReadOnlyPaths= InaccessiblePaths= EnvironmentFile=
                         ProtectSystem= ProtectHome= RuntimeDirectory= PassEnvironment='

            COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
            return 0
            ;;
        -H|--host)
            local comps=$(compgen -A hostname)

            COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
            return 0
            ;;
        -M|--machine)
            local comps=$( __get_machines )

            COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
            return 0
            ;;
        --timer-property)
            local comps='AccuracySec= WakeSystem='
            COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
            return 0
            ;;
        --working-directory)
            local comps
            if [[ -z $cur ]]; then
                comps=$(compgen -A directory -- "/" )
            else
                comps=$(compgen -A directory -- "$cur" )
            fi
            compopt -o filenames
            COMPREPLY=( $(compgen -W '$comps' -- "$cur" ) )
            return 0
            ;;
    esac

    COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
    return 0
}

complete -F _systemd_run systemd-run
