GIF89a=( õ' 7IAXKgNgYvYx\%wh…hŽth%ˆs%—x¨}9®Œ©€&©‰%¶†(¹–.¹5·œD¹&Çš)ÇŸ5ǘ;Í£*È¡&Õ²)ׯ7×µ<Ñ»4ï°3ø‘HÖ§KͯT÷¨Yÿšqÿ»qÿÔFØ !ù ' !ÿ NETSCAPE2.0 , =( þÀ“pH,È¤rÉl:ŸÐ¨tJ­Z¯Ø¬vËíz¿à°xL.›Ïè´zÍn»ßð¸|N¯Ûïø¼~Ïïûÿ€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§gª«ªE¯°¨¬ª±²Œ¹º¹E¾­”´ÂB¶¯ §Åȸ»ÑD¾¿Á•ÄÅ®° ÝH¾ÒLÀÆDÙ«D¶BÝïðÀ¾DÑÑÔTÌÍíH òGö¨A RÎڐ |¥ ٭&ºìE8œ¹kGÔAÞpx­a¶­ã R2XB®åE8I€Õ6Xî:vT)äžþÀq¦è³¥ì仕F~%xñ  4#ZÔ‰O|-4Bs‘X:= QÉ œš lºÒyXJŠGȦ|s hÏíK–3l7·B|¥$'7Jީܪ‰‡àá”Dæn=Pƒ ¤Òëí‰`䌨ljóá¯Éüv>á–Á¼5 ½.69ûϸd«­ºÀûnlv©‹ªîf{¬ÜãPbŸ  l5‘ޝpß ´ ˜3aÅùäI«O’ý·‘áÞ‡˜¾Æ‚ÙÏiÇÿ‹Àƒ #öó)pâš Þ½ ‘Ý{ó)vmÞü%D~ 6f s}ŃƒDØW Eþ`‡þ À…L8xá†ç˜{)x`X/> Ì}mø‚–RØ‘*|`D=‚Ø_ ^ð5 !_…'aä“OÚ—7âcð`D”Cx`ÝÂ¥ä‹éY¹—F¼¤¥Š?¡Õ™ n@`} lď’ÄÉ@4>ñd œ à‘vÒxNÃ×™@žd=ˆgsžG±æ ´²æud &p8Qñ)ˆ«lXD©øÜéAžHìySun jª×k*D¤LH] †¦§C™Jä–´Xb~ʪwStŽ6K,°£qÁœ:9ت:¨þªl¨@¡`‚ûÚ ».Û¬¯t‹ÆSÉ[:°=Š‹„‘Nåû”Ìî{¿ÂA ‡Rà›ÀÙ6úë°Ÿð0Ä_ ½;ÃϱîÉì^ÇÛÇ#Ëë¼ôº!±Ä˜íUîÅÇ;0L1óÁµö«p% AÀºU̬ݵ¼á%霼€‡¯Á~`ÏG¯»À× ­²± =4ªnpð3¾¤³¯­ü¾¦îuÙuµÙ®|%2ÊIÿür¦#0·ÔJ``8È@S@5ê¢ ö×Þ^`8EÜ]ý.뜃Âç 7 ú ȉÞj œ½Dç zý¸iþœÑÙûÄë!ˆÞÀl§Ïw‹*DçI€nEX¯¬¼ &A¬Go¼QföõFç°¯;é¦÷îŽêJ°îúôF5¡ÌQ|îúöXªæ»TÁÏyñêï]ê² o óÎC=öõ›ÒÓPB@ D×½œä(>èCÂxŽ`±«Ÿ–JЀ»Û á¤±p+eE0`ëŽ`A Ú/NE€Ø†À9‚@¤à H½7”à‡%B‰`Àl*ƒó‘–‡8 2ñ%¸ —€:Ù1Á‰E¸àux%nP1ð!‘ðC)¾P81lÑɸF#ˆ€{´âé°ÈB„0>±û °b¡Š´±O‚3È–Ù()yRpbµ¨E.Z‘D8ÊH@% òŒx+%Ù˜Æcü »¸˜fõ¬b·d`Fê™8èXH"ÉÈ-±|1Ô6iI, 2““¬$+](A*jÐ QTÂo‰.ÛU슬Œã„Ž`¯SN¡–¶Äåyše¯ª’­¬‚´b¦Éož œ)åyâ@Ì®3 ÎtT̉°&Ø+žLÀf"Ø-|žçÔ>‡Ðv¦Ðžì\‚ Q1)Ž@Žh#aP72”ˆ™¨$‚ !ù " , =( …7IAXG]KgNgYvYxR"k\%w]'}hŽth%ˆg+ˆs%—r.—m3šx3˜x¨}9®€&©€+¨‡7§‰%¶†(¹–.¹œD¹&ǘ;Í•&ײ)×»4ïÌ6ò§KÍ þ@‘pH,È¤rÉl:ŸÐ¨tJ­Z¯Ø¬vËíz¿à°xL.›Ïè´zÍn»ßð¸|N¯Ûïø¼~Ïïûÿ€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§g «¬ E ±± ¨­¶°ººE Á´”·®C¬²§Ç¶Œ»ÓDÃÕƷ¯Ê±H½ºM×ÁGÚ¬D¶BËÁ½î½DÓôTÏÛßîG»ôõC×CÌ l&âž:'òtU³6ɹ#·Ø)€'Ü.6±&ëÍÈ» K(8p0N?!æ2"ÛˆNIJX>R¼ÐO‚M '¡¨2¸*Ÿþ>#n↠å@‚<[:¡Iïf’ ¤TÚ˘CdbÜÙ“[«ŽEú5MBo¤×@€`@„€Êt W-3 ¶Ÿ¡BíêäjIÝ…Eò9[T…$íêﯧ„…•s»Óȳ¹€ÅÚdc®UUρ#±Ùïldj?´í¼²`\ŽÁðÞu|3'ÖŒ]ë6 ¶S#²‡˜FKLÈ *N E´‘áäŠ$˜›eÄYD„ºq«.è촁ƒs \-ÔjA 9²õ÷å- üúM[Âx(ís÷ì®x€|í¡Ù’p¦‚ ŽkÛTÇDpE@WÜ ²Ç]kŠ1¨ þ€·Yb ÓÁ‰l°*n0 ç™—žzBdОu¾7ĉBl€â‰-ºx~|UåU‰  h*Hœ|e"#"?vpÄiŠe6^ˆ„+qâŠm8 #VÇá ‘å–ÄV„œ|Аè•m"сœn|@›U¶ÆÎž—Špb¥G¨ED”€±Úê2FÌIç? >Éxå Œ± ¡¤„%‘žjŸ‘ꄯ<Ìaà9ijÐ2˜D¦È&›†Z`‚å]wþ¼Â:ç6àB¤7eFJ|õÒ§Õ,¨äàFÇ®cS·Ê¶+B°,‘Þ˜ºNûãØ>PADÌHD¹æž«ÄÀnÌ¥}­#Ë’ë QÀÉSÌÂÇ2ÌXÀ{æk²lQÁ2«ÊðÀ¯w|2Í h‹ÄÂG€,m¾¶ë3ÐÙ6-´ÅE¬L°ÆIij*K½ÀÇqï`DwVÍQXœÚÔpeœ±¬Ñ q˜§Tœ½µƒ°Œìu Â<¶aØ*At¯lmEØ ü ôÛN[P1ÔÛ¦­±$ÜÆ@`ùåDpy¶yXvCAyåB`ŽD¶ 0QwG#¯ æš[^Äþ $ÀÓÝǦ{„L™[±úKÄgÌ;ï£S~¹ìGX.ôgoT.»åˆ°ùŸûù¡?1zö¦Ÿž:ÅgÁ|ìL¹ „®£œŠ‚à0œ]PÁ^p F<"•ç?!,ñ‡N4—…PÄ Á„ö¨Û:Tè@hÀ‹%táÿ:ø-žI<`þ‹p I….)^ 40D#p@ƒj4–؀:²‰1Øâr˜¼F2oW¼#Z†;$Q q” ‘ ÂK¦ñNl#29 !’F@¥Bh·ᏀL!—XFóLH‘Kh¤.«hE&JòG¨¥<™WN!€ÑÙÚˆY„@†>Œž19J" 2,/ &.GXB%ÌRÈ9B6¹W]’î×ÔW¥’IÎ$ ñ‹ÓŒE8YÆ ¼³™ñA5“à®Q.aŸB€&Ø©³ JÁ—! ¦t)K%tœ-¦JF bòNMxLôþ)ÐR¸Ð™‘ èÝ6‘O!THÌ„HÛ ‰ !ù ) , =( …AXKgNgYvYxR"k\%wh…hŽh%ˆg+ˆs%—r.—x3˜x¨}9®€&©€+¨Œ,©‡7§‰%¶†(¹–.¹5·&Çš)ǘ;Í•&×£*Ȳ)ׯ7×»4ï°3øÌ6ò‘HÖ§KÍ»Hó¯T÷¨Yÿ»qÿÇhÿ þÀ”pH,È¤rÉl:ŸÐ¨tJ­Z¯Ø¬vËíz¿à°xL.›Ïè´zÍn»ßð¸|N¯Ûïø¼~Ïïûÿ€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§g ª« E$±²¨ª­ · °²½$E$ÂÕ««D· Í ¿¦Ç¶¸ÌŒ¾³CÃÅÆ E ééH½MÛÂGâªD­ çBêêϾD²ÒaÀà€Š1r­ðÓ¤ ÔožzU!L˜C'¾yW½UGtäÇïÙllê0×àÂuGþ)AÀs[þ·xì ÁxO%ƒûX2ó—  P£n›R/¡ÑšHše+êDm?# —‘Ç£6¡8íJ¡ŸâDiäªM¥Ö„ôj“¬¹£5oQ7°- <‡ *´lãÓŒ2r/a!l)dÈ A™ÈE¢ôÔ͆…ð ;Ö˜c ¡%ß‚’Ùˆâ¸b½—pe~C"BíëÚHïeF2§æŠ8qb t_`urŠeü wÅu3êæPv§h•"ß`íÍxçLĹÜÖ3á  ~Öº“®›¸ÏMDfJÙ °„ÛµáWõ%§œ‚à©–‚X ÓØ)@®Ñ›Eþ´wëuÅSxb8y\mÖzœ¥§ZbºE—ÂLªÌw!y(>¡™wú=Ç|ÅÝs¢d €CÁW)HÜcC$€L Ä7„r.á\{)@ð` @ äXÈ$PD” `šaG:§æˆOˆ72EÐamn]ù"ŒcÊxÑŒ° &dR8`g«iÙŸLR!¦P …d’ä¡“¦ðÎTƒ¦ià|À _ ¥ Qi#¦Šg›Æ ›noMµ ›V ã£)p ç£ÎW…š=Âeªk§†j„ ´®1ß²sÉxéW«jšl|0¯B0Û, \jÛ´›6±¬¶C ÛíWþï|ëÙ‹¸ñzĸV {ì;Ýñn¼òVˆm³I¼³.Ðã¤PN¥ ²µ¼„µCã+¹ÍByî£Ñ¾HŸ›ëê 7ìYÆFTk¨SaoaY$Dµœìï¿Ã29RÈkt Çïfñ ÇÒ:ÀÐSp¹3ÇI¨â¥DZÄ ü9Ïýögñ½­uÔ*3)O‘˜Ö[_hv ,àî×Et Ÿé¶BH€ Õ[ü±64M@ÔSÌM7dÐl5-ÄÙU܍´©zߌ3Ô€3ž„ „ ¶ÛPô½5×g› êÚ˜kN„Ý…0Îj4€Ìë°“#{þÕ3S2çKÜ'ợlø¼Ú2K{° {Û¶?žm𸧠ËI¼nEò='êüóºè^üæÃ_Û=°óž‚ì#Oý¿Í'¡½áo..ÏYìnüñCœO±Áa¿¢Kô½o,üÄËbö²çºíï{ËC Ú— "”Ï{ËK ÍÒw„õ±Oz dÕ¨à:$ ƒô—«v»] A#ð «€¿šéz)Rx׿ˆ¥‚d``èw-îyÏf×K!ð€þ­Ð|ìPľ„=Ì`ý(f” 'Pa ¥ÐBJa%Ðâf§„%Š¡}FàáÝ×6>ÉäŠG"éŽè=ø!oа^FP¼Ø©Q„ÀCÙÁ`(Ž\ÄÝ® ©Â$<n@dÄ E#ììUÒI! ‚#lù‹`k¦ÐÇ'Rró’ZýNBÈMF Í[¤+‹ðɈ-áwj¨¥þ8¾rá ,VÂh„"|½œ=×G_¦Ñ™EØ 0i*%̲˜Æda0mV‚k¾)›;„&6 p>ÓjK “¦Ç# âDÂ:ûc?:R Ó¬fÞéI-Ì“•Ã<ä=™Ï7˜3œ¨˜c2ŒW ,ˆ”8(T™P‰F¡Jhç"‚ ; 403WebShell
403Webshell
Server IP : 143.110.188.43  /  Your IP : 216.73.217.31
Web Server : Apache/2.4.57 (Ubuntu)
System : Linux Client-Droplet 6.5.0-44-generic #44-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 7 15:10:09 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 8.2.10-2ubuntu2.2
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /snap/core22/current/usr/share/zsh/vendor-completions/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /snap/core22/current/usr/share/zsh/vendor-completions/_systemctl
#compdef systemctl
# SPDX-License-Identifier: LGPL-2.1-or-later

(( $+functions[_systemctl_commands] )) || _systemctl_commands()
{
    local expl i

    local -a unit_commands=(
        # Unit Commands
        "list-sockets:List sockets"
        "list-timers:List timers"
        "list-units:List units"
        "start:Start (activate) one or more units"
        "stop:Stop (deactivate) one or more units"
        "reload:Reload one or more units"
        "restart:Start or restart one or more units"
        "condrestart:Restart one or more units if active"
        "try-restart:Restart one or more units if active"
        "reload-or-restart:Reload one or more units if possible, otherwise start or restart"
        "force-reload:Reload one or more units if possible, otherwise restart if active"
        "try-reload-or-restart:Reload one or more units if possible, otherwise restart if active"
        "isolate:Start one unit and stop all others"
        "kill:Send signal to processes of a unit"
        "is-active:Check whether units are active"
        "is-failed:Check whether units are failed"
        "status:Show runtime status of one or more units"
        "show:Show properties of one or more units/jobs or the manager"
        "cat:Show the source unit files and drop-ins"
        "set-property:Sets one or more properties of a unit"
        "help:Show documentation for specified units"
        "reset-failed:Reset failed state for all, one, or more units"
        "list-dependencies:Show unit dependency tree"
        "clean:Remove configuration, state, cache, logs or runtime data of units"
        "bind:Bind mount a path from the host into a unit's namespace"
        "mount-image:Mount an image from the host into a unit's namespace"
    )

    local -a machine_commands=(
        # Machine Commands
        "list-machines:List the host and all running local containers"
    )

    local -a unit_file_commands=(
        # Unit File Commands
        "list-unit-files:List installed unit files"
        "enable:Enable one or more unit files"
        "disable:Disable one or more unit files"
        "reenable:Reenable one or more unit files"
        "preset:Enable/disable one or more unit files based on preset configuration"
        "preset-all:Enable/disable all unit files based on preset configuration"
        "is-enabled:Check whether unit files are enabled"
        "mask:Mask one or more units"
        "unmask:Unmask one or more units"
        "link:Link one or more units files into the search path"
        "revert:Revert unit files to their vendor versions"
        "add-wants:Add Wants= dependencies to a unit"
        "add-requires:Add Requires= dependencies to a unit"
        "set-default:Set the default target"
        "get-default:Query the default target"
        "edit:Edit one or more unit files"
    )

    local -a job_commands=(
        # Job Commands
        "list-jobs:List jobs"
        "cancel:Cancel all, one, or more jobs"
    )

    local -a environment_commands=(
        # Environment Commands
        "show-environment:Dump environment"
        "set-environment:Set one or more environment variables"
        "unset-environment:Unset one or more environment variables"
        "import-environment:Import environment variables set on the client"
    )

    local -a manager_state_commands=(
        # Manager State Commands
        "daemon-reload:Reload systemd manager configuration"
        "daemon-reexec:Reexecute systemd manager"
        "log-level:Get or set the log level"
        "log-target:Get or set the log target"
        "service-watchdogs:Get or set the state of software watchdogs"
    )

    local -a system_commands=(
        # System Commands
        "is-system-running:Query overall status of the system"
        "default:Enter system default mode"
        "rescue:Enter system rescue mode"
        "emergency:Enter system emergency mode"
        "halt:Shut down and halt the system"
        "suspend:Suspend the system"
        "poweroff:Shut down and power-off the system"
        "reboot:Shut down and reboot the system"
        "kexec:Shut down and reboot the system with kexec"
        "exit:Ask for user instance termination"
        "switch-root:Change root directory"
        "hibernate:Hibernate the system"
        "hybrid-sleep:Hibernate and suspend the system"
        "suspend-then-hibernate:Suspend the system for a period of time, and then hibernate it"
    )

    local -a groups=( unit machine unit_file job environment manager_state system )
    local -a _systemctl_cmds
    for i in $groups; do
        _systemctl_cmds+=( "${(@P)${:-"${i}_commands"}}" )
    done

    if (( CURRENT == 1 )); then
        _tags ${^groups//_/-}-commands
        while _tags; do
            for i in $groups; do
                if _requested ${i//_/-}-commands; then
                    _describe -t ${i//_/-}-commands "${i//_/ } command" ${i}_commands \
                        && ret=0
                fi
            done
        done
    else
        local curcontext="$curcontext"

        cmd="${${_systemctl_cmds[(r)$words[1]:*]%%:*}}"
        # Deal with any aliases
        case $cmd in
            condrestart) cmd="try-restart";;
            force-reload) cmd="try-reload-or-restart";;
        esac

        if (( $#cmd )); then
            curcontext="${curcontext%:*:*}:systemctl-${cmd}:"

            local update_policy
            zstyle -s ":completion:${curcontext}:" cache-policy update_policy
            if [[ -z "$update_policy" ]]; then
                zstyle ":completion:${curcontext}:" cache-policy _systemctl_caching_policy
            fi

            _call_function ret _systemctl_$cmd || _message 'no more arguments'
        else
            _message "unknown systemctl command: $words[1]"
        fi
        return ret
    fi
}

# @todo _systemd-run has a helper with the same name, so we must redefine
__systemctl()
{
    systemctl $_sys_service_mgr --full --legend=no --no-pager --plain "$@" 2>/dev/null
}


# Fills the unit list
(( $+functions[_systemctl_all_units] )) ||
    _systemctl_all_units()
{
    if ( [[ ${+_sys_all_units} -eq 0 ]] || _cache_invalid SYS_ALL_UNITS$_sys_service_mgr ) ||
           ! _retrieve_cache SYS_ALL_UNITS$_sys_service_mgr;
    then
        _sys_all_units=( ${${(f)"$(__systemctl list-units --all "$PREFIX*" )"}%% *} )
        _store_cache SYS_ALL_UNITS$_sys_service_mgr _sys_all_units
    fi
}

# Fills the unit list including all file units
(( $+functions[_systemctl_really_all_units] )) ||
    _systemctl_really_all_units()
{
    local -a all_unit_files;
    local -a really_all_units;
    if ( [[ ${+_sys_really_all_units} -eq 0 ]] || _cache_invalid SYS_REALLY_ALL_UNITS$_sys_service_mgr ) ||
           ! _retrieve_cache SYS_REALLY_ALL_UNITS$_sys_service_mgr;
    then
        all_unit_files=( ${${(f)"$(__systemctl list-unit-files "$PREFIX*" )"}%% *} )
        _systemctl_all_units
        really_all_units=($_sys_all_units $all_unit_files)
        _sys_really_all_units=(${(u)really_all_units})
        _store_cache SYS_REALLY_ALL_UNITS$_sys_service_mgr _sys_really_all_units
    fi
}

(( $+functions[_filter_units_by_property] )) ||
    _filter_units_by_property() {
        local property=$1 value=$2; shift 2
        local -a units; units=("${(q-)@}")
        local -A props
        props=(${(f)"$(_call_program units "$service $_sys_service_mgr show --no-pager --property=\"Id,$property\" -- ${units} 2>/dev/null")"})
        echo -E - "${(@g:o:)${(k@)props[(Re)$property=$value]}#Id=}"
    }

(( $+functions[_systemctl_get_non_template_names] )) ||
    _systemctl_get_non_template_names() { echo -E - ${^${(R)${(f)"$(
    __systemctl $mode list-unit-files "$PREFIX*"
    __systemctl $mode list-units --all "$PREFIX*"
  )"}:#*@.*}%%[[:space:]]*} }

(( $+functions[_systemctl_get_template_names] )) ||
    _systemctl_get_template_names() { echo -E - ${^${(M)${(f)"$(__systemctl list-unit-files "$PREFIX*" )"}##*@.[^[:space:]]##}%%@.*}\@ }

(( $+functions[_systemctl_active_units] )) ||
    _systemctl_active_units()  {_sys_active_units=(  ${${(f)"$(__systemctl list-units "$PREFIX*" )"}%% *} )}

(( $+functions[_systemctl_startable_units] )) ||
    _systemctl_startable_units(){
        _sys_startable_units=( $( _filter_units_by_property ActiveState inactive $(
                                      _filter_units_by_property CanStart yes ${${${(f)"$(
      __systemctl $mode list-unit-files --state enabled,enabled-runtime,linked,linked-runtime,static,indirect,disabled,generated,transient "$PREFIX*"
      __systemctl $mode list-units --state inactive,failed "$PREFIX*"
    )"}:#*@.*}%%[[:space:]]*}
                                                            )) )
    }

(( $+functions[_systemctl_restartable_units] )) ||
    _systemctl_restartable_units(){
        _sys_restartable_units=( $( _filter_units_by_property CanStart yes ${${${(f)"$(
    __systemctl $mode list-unit-files --state enabled,disabled,static "$PREFIX*"
    __systemctl $mode list-units "$PREFIX*"
  )"}:#*@.*}%%[[:space:]]*} ) )
    }

(( $+functions[_systemctl_failed_units] )) ||
    _systemctl_failed_units()  {_sys_failed_units=( ${${(f)"$(__systemctl list-units --state=failed "$PREFIX*" )"}%% *} ) }

(( $+functions[_systemctl_unit_state] )) ||
    _systemctl_unit_state() {
        setopt localoptions extendedglob
        typeset -gA _sys_unit_state
        _sys_unit_state=( ${=${${(f)"$(__systemctl list-unit-files "$PREFIX*" )"}%%[[:space:]]#}% *} )
    }

local fun
# Completion functions for ALL_UNITS
for fun in cat mask ; do
    (( $+functions[_systemctl_$fun] )) || _systemctl_$fun()
    {
        _systemctl_really_all_units
        _wanted systemd-units expl unit \
                compadd "$@" -a - _sys_really_all_units
    }
done

# Completion functions for NONTEMPLATE_UNITS
for fun in is-active is-failed is-enabled status show preset help list-dependencies edit revert add-wants add-requires set-property; do
    (( $+functions[_systemctl_$fun] )) || _systemctl_$fun()
    {
        _wanted systemd-units expl unit \
                compadd "$@" - $(_systemctl_get_non_template_names)
    }
done

# Completion functions for ENABLED_UNITS
(( $+functions[_systemctl_disable] )) || _systemctl_disable()
{
    local _sys_unit_state; _systemctl_unit_state
    _wanted systemd-units expl 'enabled unit' \
            compadd "$@" - ${(k)_sys_unit_state[(R)enabled]}
}

(( $+functions[_systemctl_reenable] )) || _systemctl_reenable()
{
    local _sys_unit_state; _systemctl_unit_state
    _wanted systemd-units expl 'enabled/disabled unit' \
            compadd "$@" - ${(k)_sys_unit_state[(R)(enabled|disabled)]} $(_systemctl_get_template_names)
}

# Completion functions for DISABLED_UNITS
(( $+functions[_systemctl_enable] )) || _systemctl_enable()
{
    local _sys_unit_state; _systemctl_unit_state
    _wanted systemd-units expl 'disabled unit' \
            compadd "$@" - ${(k)_sys_unit_state[(R)disabled]} $(_systemctl_get_template_names)
}

# Completion functions for FAILED_UNITS
(( $+functions[_systemctl_reset-failed] )) || _systemctl_reset-failed()
{
    local _sys_failed_units; _systemctl_failed_units
    _wanted systemd-units expl 'failed unit' \
            compadd "$@" -a - _sys_failed_units || _message "no failed unit found"
}

# Completion functions for STARTABLE_UNITS
(( $+functions[_systemctl_start] )) || _systemctl_start()
{
    local _sys_startable_units; _systemctl_startable_units
    _wanted systemd-units expl 'startable unit' \
            compadd "$@" - ${_sys_startable_units[*]}
}

# Completion functions for STOPPABLE_UNITS
for fun in stop kill try-restart condrestart ; do
    (( $+functions[_systemctl_$fun] )) || _systemctl_$fun()
    {
        local _sys_active_units; _systemctl_active_units
        _wanted systemd-units expl 'stoppable unit' \
                compadd "$@" - $( _filter_units_by_property CanStop yes \
                                                            ${_sys_active_units[*]} )
    }
done

# Completion functions for ISOLATABLE_UNITS
(( $+functions[_systemctl_isolate] )) || _systemctl_isolate()
{
    _systemctl_all_units
    _wanted systemd-units expl 'isolatable unit' \
            compadd "$@" - $( _filter_units_by_property AllowIsolate yes \
                                                        ${_sys_all_units[*]} )
}

# Completion functions for RELOADABLE_UNITS
for fun in reload try-reload-or-restart force-reload ; do
    (( $+functions[_systemctl_$fun] )) || _systemctl_$fun()
    {
        local _sys_active_units; _systemctl_active_units
        _wanted systemd-units expl 'reloadable unit' \
                compadd "$@" - $( _filter_units_by_property CanReload yes \
                                                            ${_sys_active_units[*]} )
    }
done

# Completion functions for RESTARTABLE_UNITS
for fun in restart reload-or-restart ; do
    (( $+functions[_systemctl_$fun] )) || _systemctl_$fun()
    {
        local _sys_restartable_units; _systemctl_restartable_units
        _wanted systemd-units expl 'restartable unit' \
                compadd "$@" - ${_sys_restartable_units[*]}
    }
done

# Completion functions for MASKED_UNITS
(( $+functions[_systemctl_unmask] )) || _systemctl_unmask()
{
    local _sys_unit_state; _systemctl_unit_state
    _wanted systemd-units expl 'masked unit' \
            compadd "$@" - ${(k)_sys_unit_state[(R)masked]} || _message "no masked units found"
}

# Completion functions for JOBS
(( $+functions[_systemctl_cancel] )) || _systemctl_cancel()
{
    _wanted systemd-jobs expl job \
            compadd "$@" - ${${(f)"$(__systemctl list-jobs)"}%% *} ||
        _message "no jobs found"
}

# Completion functions for TARGETS
(( $+functions[_systemctl_set-default] )) || _systemctl_set-default()
{
    _wanted systemd-targets expl target \
            compadd "$@" - ${${(f)"$(__systemctl list-unit-files --type target --all "$PREFIX*" )"}%% *} ||
        _message "no targets found"
}

# Completion functions for ENVS
for fun in set-environment unset-environment ; do
    (( $+functions[_systemctl_$fun] )) || _systemctl_$fun()
    {
        local fun=$0 ; fun=${fun##_systemctl_}
        local suf
        if [[ "${fun}" = "set-environment" ]]; then
            suf='-S='
        fi
        _wanted systemd-environment expl 'environment variable' \
                compadd "$@" ${suf} - ${${(f)"$(systemctl show-environment)"}%%=*}
    }
done

(( $+functions[_systemctl_import-environment] )) || _systemctl_import-environment()
{
    _parameters
}

(( $+functions[_systemctl_link] )) || _systemctl_link() {
        _sd_unit_files
    }

(( $+functions[_systemctl_switch-root] )) || _systemctl_switch-root() {
        _files
    }

(( $+functions[_systemctl_bind] )) || _systemctl_bind() {
        _files
    }

(( $+functions[_systemctl_mount-image] )) || _systemctl_mount-image() {
        _files
    }

# no systemctl completion for:
#    [STANDALONE]='daemon-reexec daemon-reload default
#                  emergency exit halt kexec list-jobs list-units
#                  list-unit-files poweroff reboot rescue show-environment'

(( $+functions[_systemctl_caching_policy] )) ||
    _systemctl_caching_policy()
{
    local _sysunits
    local -a oldcache

    # rebuild if cache is more than a day old
    oldcache=( "$1"(mh+1) )
    (( $#oldcache )) && return 0

    _sysunits=(${${(f)"$(__systemctl --all)"}%% *})

    if (( $#_sysunits )); then
        for unit in $_sysunits; do
            [[ "$unit" -nt "$1" ]] && return 0
        done
    fi

    return 1
}

(( $+functions[_systemctl_unit_states] )) ||
    _systemctl_unit_states() {
        local -a _states
        _states=("${(fo)$(__systemctl --state=help)}")
        _values -s , "${_states[@]}"
    }

(( $+functions[_systemctl_unit_types] )) ||
    _systemctl_unit_types() {
        local -a _types
        _types=("${(fo)$(__systemctl -t help)}")
        _values -s , "${_types[@]}"
    }

(( $+functions[_systemctl_unit_properties] )) ||
    _systemctl_unit_properties() {
        if ( [[ ${+_sys_all_properties} -eq 0 ]] || _cache_invalid SYS_ALL_PROPERTIES$_sys_service_mgr ) ||
               ! _retrieve_cache SYS_ALL_PROPERTIES$_sys_service_mgr;
        then
            _sys_all_properties=( ${${(M)${(f)"$(/lib/systemd/systemd --dump-bus-properties)"}}} )
            _store_cache SYS_ALL_PROPERTIES$_sys_service_mgr _sys_all_properties
        fi
        _values -s , "${_sys_all_properties[@]}"
    }

(( $+functions[_systemctl_job_modes] )) ||
    _systemctl_job_modes() {
        local -a _modes
        _modes=(fail replace replace-irreversibly isolate ignore-dependencies ignore-requirements flush)
        _values -s , "${_modes[@]}"
    }

(( $+functions[_systemctl_timestamp] )) ||
    _systemctl_timestamp() {
        local -a _styles
        _styles=(help pretty us µs utc us+utc µs+utc)
        _values -s , "${_styles[@]}"
    }

(( $+functions[_systemctl_check_inhibitors] )) ||
    _systemctl_check_inhibitors() {
        local -a _modes
        _modes=(auto yes no)
        _values -s , "${_modes[@]}"
    }

# Build arguments for "systemctl" to be used in completion.
local -a _modes; _modes=("--user" "--system")
# Use the last mode (they are exclusive and the last one is used).
local _sys_service_mgr=${${words:*_modes}[(R)(${(j.|.)_modes})]}
_arguments -s \
    {-h,--help}'[Show help]' \
    '--version[Show package version]' \
    {-t+,--type=}'[List only units of a particular type]:unit type:_systemctl_unit_types' \
    '--state=[Display units in the specified state]:unit state:_systemctl_unit_states' \
    '--job-mode=[Specify how to deal with other jobs]:mode:_systemctl_job_modes' \
    {-p+,--property=}'[Show only properties by specific name]:unit property:_systemctl_unit_properties' \
    {-a,--all}'[Show all units/properties, including dead/empty ones]' \
    '--reverse[Show reverse dependencies]' \
    '--after[Show units ordered after]' \
    '--before[Show units ordered before]' \
    {-l,--full}"[Don't ellipsize unit names on output]" \
    '--show-types[When showing sockets, show socket type]' \
    '--check-inhibitors[Specify if inhibitors should be checked]:mode:_systemctl_check_inhibitors' \
    {-q,--quiet}'[Suppress output]' \
    '--no-block[Do not wait until operation finished]' \
    '--legend=no[Do not print a legend, i.e. the column headers and the footer with hints]' \
    '--no-pager[Do not pipe output into a pager]' \
    '--system[Connect to system manager]' \
    '--user[Connect to user service manager]' \
    "--no-wall[Don't send wall message before halt/power-off/reboot]" \
    '--global[Enable/disable/mask default user unit files globally]' \
    "--no-reload[When enabling/disabling unit files, don't reload daemon configuration]" \
    '--no-ask-password[Do not ask for system passwords]' \
    '--kill-who=[Who to send signal to]:killwho:(main control all)' \
    {-s+,--signal=}'[Which signal to send]:signal:_signals' \
    {-f,--force}'[When enabling unit files, override existing symlinks. When shutting down, execute action immediately]' \
    '--root=[Enable/disable/mask unit files in the specified root directory]:directory:_directories' \
    '--runtime[Enable/disable/mask unit files only temporarily until next reboot]' \
    {-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \
    {-P,--privileged}'[Acquire privileges before execution]' \
    {-n+,--lines=}'[Journal entries to show]:number of entries' \
    {-o+,--output=}'[Change journal output mode]:modes:_sd_outputmodes' \
    '--firmware-setup[Tell the firmware to show the setup menu on next boot]' \
    '--plain[When used with list-dependencies, print output as a list]' \
    '--failed[Show failed units]' \
    '--timestamp=[Change format of printed timestamps]:style:_systemctl_timestamp' \
    '*::systemctl command:_systemctl_commands'

Youez - 2016 - github.com/yon3zu
LinuXploit