Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 18.190.153.171
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : _rvm
#compdef rvm

\typeset curcontext state line cmds ret

curcontext="$curcontext"
ret=1

_arguments -C \
  '(- 1 *)'{-v,--version}'[display version information]' \
  '(-l|--level)'{-l,--level}'+[patch level to use with rvm use / install]:number' \
  '(--bin)--bin[path for binaries to be placed (~/.rvm/bin/)]:path:_files' \
  '(--source)--source[src directory to use (~/.rvm/src/)]:path:_files' \
  '(--archives)--archives[directory for downloaded files (~/.rvm/archives/)]:path:_files' \
  '-S[Specify a script file to attempt to load and run (rubydo)]:file:_files' \
  '-e[Execute code from the command line]:code' \
  '(-G)-G[root gem path to use]:path:_files' \
  '(--gems)--gems[Used to set the gems_flag, use with remove to remove gems]' \
  '(--archive)--archive[Used to set the archive_flag, use with remove to remove archive]' \
  '(--patch)--patch[With MRI Rubies you may specify one or more full paths to patches]' \
  '(-C|--configure)'{-C,--configure}'=[custom configure options]' \
  '(--nice)--nice[process niceness (for slow computers, default 0)]:number' \
  '(--ree)--ree-options[Options passed directly to ree ./installer on the command line]:options' \
  '(--head)--head[with update, updates rvm to git head version]' \
  '(--rubygems)--rubygems[with update, updates rubygems for selected ruby]' \
  '(--default)--default[with ruby select, sets a default ruby for new shells]' \
  '(--debug)--debug[Toggle debug mode on for very verbose output]' \
  '(--trace)--trace[Toggle trace mode on to see EVERYTHING rvm is doing]' \
  '(--force)--force[Force install, even given ruby is already install]' \
  '(--summary)--summary[Used with rubydo to print out a summary of the commands run]' \
  '(--latest)--latest[with gemset --dump skips version strings for latest gem]' \
  '(--gems)--gems[with uninstall/remove removes gems with the interpreter]' \
  '(--docs)--docs[with install, attempt to generate ri after installation]' \
  '(--reconfigure)--reconfigure[Force ./configure on install even if Makefile already exists]' \
  '(--quiet-curl)--quiet-curl[Makes curl silent when fetching data]' \
  '1: :->cmds' \
  '*: :->args' && ret=0

case $state in

  cmds)

    cmds=( ${(f)"$(_call_program commands rvm help 2> /dev/null | __rvm_sed -e '/^== Action/,/^== Implementation/!d; / :: /!d; s/^[ *]*\([^ ]*\) *:: *\(.*\)/\1:\2/')"} )
    cmds+=( $(rvm list strings) )
    _describe -t commands 'rvm command' cmds && ret=0
    ;;

  args)

    case $line[1] in

      (use|uninstall|remove|list)

        if (( CURRENT == 3 )); then
          # See if we’ve made it to the ‘@’; eg, 1.9.2@
          if ! __rvm_grep '@' <<< "${line[CURRENT-1]}" >/dev/null ; then
            _values -S , 'rubies' \
              $(rvm list strings | __rvm_sed -e 's/ruby-\([^) ]*\)-\([^) ]*\)/ruby-\1-\2 \1-\2 \1/g') \
              default system $(rvm alias list names) && ret=0
          else
            # Construct a full version string for each of the gemsets.
            # Eg, 1.9.2@min 1.9.2@rail3 …
            _values -S , 'gemsets' \
              $(rvm ${line[CURRENT-1]%%@*} gemset list | __rvm_awk '/^[ -_[:alnum:]]+$/ {print "'${line[CURRENT-1]%%@*}'@"$1}')
          fi
        fi
        ;;

      (install|fetch)

        _values -S , 'rubies' $(rvm list known_strings) && ret=0
        ;;

      gemset)

        if (( CURRENT == 3 )); then
          _values 'gemset_commands' $(rvm gemset help | __rvm_sed -e '/create/!d; s/^.*[{]\(.*\)[}].*$/\1/; s/,/ /g')
        else
          #_values -S , 'gemsets' $(rvm gemset list | __rvm_grep -v gemset 2>/dev/null)
          _values -S , 'gemsets' $(rvm gemset list | __rvm_grep -Ev '(gemset|info)' 2>/dev/null | __rvm_awk '/^[ -_[:alnum:]]+$/ {print '$1'}')
        fi
        ret=0
        ;;

      package)

        if (( CURRENT == 3 )); then
          _values 'package_commands' $(rvm package | __rvm_sed -e '/Usage/!d; s/^.*[{]\(.*\)[}] [{].*$/\1/; s/,/ /g')
        else
          _values 'packages' $(rvm package | __rvm_sed -e '/Usage/!d; s/^.*[}] [{]\(.*\)[}].*$/\1/; s/,/ /g')
        fi
        ret=0
        ;;

      *)
        (( ret )) && _message 'no more arguments'
        ;;

    esac
    ;;
esac

return ret
© 2025 GrazzMean