Server IP : 85.214.239.14 / Your IP : 3.23.103.14 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /proc/2/root/proc/3/cwd/proc/2/root/usr/share/bash-completion/completions/ |
Upload File : |
# bash completion for puppet -*- shell-script -*- _puppet_logdest() { if [[ -z $cur ]]; then COMPREPLY=($(compgen -W 'syslog console /' -- "$cur")) else COMPREPLY=($(compgen -W 'syslog console' -- "$cur")) _filedir fi } _puppet_digest() { COMPREPLY=($(compgen -W 'MD5 MD2 SHA1 SHA256' -- "$cur")) } _puppet_certs() { local puppetca="puppet cert" PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin type puppetca &>/dev/null && puppetca=puppetca if [[ $1 == --all ]]; then cert_list=$($puppetca --list --all | command sed -e 's/^[+-]\{0,1\}\s*\(\S\+\)\s\+.*$/\1/') else cert_list=$($puppetca --list) fi COMPREPLY+=($(compgen -W "$cert_list" -- "$cur")) } _puppet_types() { puppet_types=$(puppet describe --list | command sed -e 's/^\(\S\{1,\}\).*$/\1/') COMPREPLY+=($(compgen -W "$puppet_types" -- "$cur")) } _puppet_references() { local puppetdoc="puppet doc" PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin type puppetdoc &>/dev/null && puppetdoc=puppetdoc puppet_doc_list=$($puppetdoc --list | command sed -e 's/^\(\S\{1,\}\).*$/\1/') COMPREPLY+=($(compgen -W "$puppet_doc_list" -- "$cur")) } _puppet_subcmd_opts() { # puppet cmd help is somewhat slow, avoid if possible [[ -z $cur || $cur == -* ]] && COMPREPLY+=($(compgen -W \ '$(_parse_usage "$1" "help $2")' -- "$cur")) } _puppet() { local cur prev words cword _init_completion || return local subcommand action case $prev in -h | --help | -V | --version) return ;; esac case ${words[0]} in puppetmasterd) subcommand=master ;; puppetd) subcommand=agent ;; puppetca) subcommand=cert ;; ralsh) subcommand=resource ;; puppetrun) subcommand=kick ;; puppetqd) subcommand=queue ;; filebucket) subcommand=filebucket ;; puppetdoc) subcommand=doc ;; pi) subcommand=describe ;; puppet) case ${words[1]} in agent | apply | cert | describe | doc | filebucket | kick | master | parser | queue | resource) subcommand=${words[1]} ;; *.pp | *.rb) subcommand=apply ;; *) COMPREPLY=($(compgen -W 'agent apply cert describe doc filebucket kick master parser queue resource' \ -- "$cur")) return ;; esac ;; esac case $subcommand in agent) case $prev in --certname) _known_hosts_real -- "$cur" return ;; --digest) _puppet_digest return ;; --fqdn) _known_hosts_real -- "$cur" return ;; -l | --logdest) _puppet_logdest return ;; --masterport) COMPREPLY=($(compgen -W '8140' -- "$cur")) return ;; -w | --waitforcert) COMPREPLY=($(compgen -W '0 15 30 60 120' -- "$cur")) return ;; *) _puppet_subcmd_opts "$1" $subcommand # _parse_usage doesn't grok [-D|--daemonize|--no-daemonize] COMPREPLY+=($(compgen -W '--no-daemonize' -- "$cur")) return ;; esac ;; apply) case $prev in --catalog) COMPREPLY=($(compgen -W '-' -- "$cur")) _filedir json return ;; --execute) return ;; -l | --logdest) _puppet_logdest return ;; *) if [[ $cur == -* ]]; then _puppet_subcmd_opts "$1" $subcommand else _filedir fi return ;; esac ;; cert) case $prev in --digest) _puppet_digest return ;; *) action=$prev COMPREPLY=($(compgen -W '--digest --debug --help --verbose --version' \ -- "$cur")) case $action in fingerprint | list | verify | --fingerprint | --list | --verify) COMPREPLY+=($(compgen -W '--all' -- "$cur")) _puppet_certs --all return ;; generate | --generate) _known_hosts_real -- "$cur" return ;; clean | print | revoke | --clean | --print | --revoke) _puppet_certs --all return ;; sign | --sign) COMPREPLY+=($(compgen -W '--all' -- "$cur")) _puppet_certs return ;; *) COMPREPLY+=($(compgen -W 'clean fingerprint generate list print revoke sign verify reinventory' -- "$cur")) return ;; esac ;; esac ;; describe) _puppet_subcmd_opts "$1" $subcommand if [[ $cur != -* ]]; then _puppet_types fi return ;; doc) case $prev in -o | --outputdir) _filedir -d return ;; -m | --mode) COMPREPLY=($(compgen -W 'text trac pdf rdoc' -- "$cur")) return ;; -r | --reference) _puppet_references return ;; *) if [[ $cur == -* ]]; then _puppet_subcmd_opts "$1" $subcommand else _filedir fi return ;; esac ;; filebucket) case $prev in -s | --server) _known_hosts_real -- "$cur" return ;; -b | --bucket) _filedir -d return ;; *) if [[ $cur == -* ]]; then _puppet_subcmd_opts "$1" $subcommand else COMPREPLY=($(compgen -W 'backup get restore' \ -- "$cur")) _filedir fi return ;; esac ;; kick) case $prev in -c | --class) return ;; --host) _known_hosts_real -- "$cur" return ;; -t | --tag) return ;; *) if [[ $cur == -* ]]; then _puppet_subcmd_opts "$1" $subcommand else _known_hosts_real -- "$cur" fi return ;; esac ;; master) case $prev in -l | --logdest) _puppet_logdest return ;; *) _puppet_subcmd_opts "$1" $subcommand # _parse_usage doesn't grok [-D|--daemonize|--no-daemonize] COMPREPLY+=($(compgen -W '--no-daemonize' -- "$cur")) return ;; esac ;; parser) action=$prev case $action in validate) _filedir pp return ;; *) COMPREPLY=($(compgen -W 'validate' -- "$cur")) return ;; esac ;; queue) case $prev in -l | --logdest) _puppet_logdest return ;; *) if [[ $cur == -* ]]; then _puppet_subcmd_opts "$1" $subcommand else _filedir fi return ;; esac ;; resource | *) _puppet_subcmd_opts "$1" $subcommand return ;; esac } && complete -F _puppet puppetmasterd puppetd puppetca ralsh puppetrun puppetqd filebucket puppetdoc puppet # ex: filetype=sh