diff --git a/.gitignore b/.gitignore index 51a5ee6c3..8fa66f02f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ locals.zsh log/.zsh_history projects.zsh -custom/* -!custom/example +custom +!custom/plugins/example !custom/example.zsh *.swp !custom/example.zshcache diff --git a/README.textile b/README.textile index c808fb5d7..4325c91eb 100644 --- a/README.textile +++ b/README.textile @@ -59,7 +59,7 @@ If you installed manually or changed the install location, check ZSH in ~/.zshrc h2. Usage -* enable the plugins you want in your @~/.zshrc@ (take a look at @plugins/@ to see what's possible) +* enable the plugins you want in your @~/.zshrc@ (take a look at the @plugins/@ directory and the "wiki":https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins to see what's possible) ** example: @plugins=(git osx ruby)@ * Theme support: Change the @ZSH_THEME@ environment variable in @~/.zshrc@. ** Take a look at the "current themes":https://wiki.github.com/robbyrussell/oh-my-zsh/themes that come bundled with _Oh My Zsh_. diff --git a/custom/example/example.plugin.zsh b/custom/plugins/example/example.plugin.zsh similarity index 100% rename from custom/example/example.plugin.zsh rename to custom/plugins/example/example.plugin.zsh diff --git a/lib/grep.zsh b/lib/grep.zsh index 93c4270b6..25345bd06 100644 --- a/lib/grep.zsh +++ b/lib/grep.zsh @@ -2,5 +2,11 @@ # Color grep results # Examples: http://rubyurl.com/ZXv # -export GREP_OPTIONS='--color=auto' + +# avoid VCS folders +GREP_OPTIONS= +for PATTERN in .cvs .git .hg .svn; do + GREP_OPTIONS+="--exclude-dir=$PATTERN " +done +export GREP_OPTIONS+='--color=auto ' export GREP_COLOR='1;32' \ No newline at end of file diff --git a/lib/history.zsh b/lib/history.zsh index 655945166..1d83e56e3 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -5,7 +5,6 @@ fi HISTSIZE=10000 SAVEHIST=10000 -setopt append_history setopt extended_history setopt hist_expire_dups_first setopt hist_ignore_dups # ignore duplication command history list diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh index 94f1842f3..5f3f237c7 100644 --- a/lib/key-bindings.zsh +++ b/lib/key-bindings.zsh @@ -15,29 +15,49 @@ if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then zle -N zle-line-finish fi -bindkey -e # Use emacs key bindings +bindkey -e # Use emacs key bindings -bindkey '\ew' kill-region # [Esc-w] - Kill from the cursor to the mark -bindkey -s '\el' 'ls\n' # [Esc-l] - run command: ls -bindkey '^r' history-incremental-search-backward # [Ctrl-r] - Search backward incrementally for a specified string. The string may begin with ^ to anchor the search to the beginning of the line. -bindkey "${terminfo[kpp]}" up-line-or-history # [PageUp] - Up a line of history -bindkey "${terminfo[knp]}" down-line-or-history # [PageDown] - Down a line of history +bindkey '\ew' kill-region # [Esc-w] - Kill from the cursor to the mark +bindkey -s '\el' 'ls\n' # [Esc-l] - run command: ls +bindkey '^r' history-incremental-search-backward # [Ctrl-r] - Search backward incrementally for a specified string. The string may begin with ^ to anchor the search to the beginning of the line. +if [[ "${terminfo[kpp]}" != "" ]]; then + bindkey "${terminfo[kpp]}" up-line-or-history # [PageUp] - Up a line of history +fi +if [[ "${terminfo[knp]}" != "" ]]; then + bindkey "${terminfo[knp]}" down-line-or-history # [PageDown] - Down a line of history +fi -bindkey "${terminfo[kcuu1]}" up-line-or-search # start typing + [Up-Arrow] - fuzzy find history forward -bindkey "${terminfo[kcud1]}" down-line-or-search # start typing + [Down-Arrow] - fuzzy find history backward +if [[ "${terminfo[kcuu1]}" != "" ]]; then + bindkey "${terminfo[kcuu1]}" up-line-or-search # start typing + [Up-Arrow] - fuzzy find history forward +fi +if [[ "${terminfo[kcud1]}" != "" ]]; then + bindkey "${terminfo[kcud1]}" down-line-or-search # start typing + [Down-Arrow] - fuzzy find history backward +fi -bindkey "${terminfo[khome]}" beginning-of-line # [Home] - Go to beginning of line -bindkey "${terminfo[kend]}" end-of-line # [End] - Go to end of line +if [[ "${terminfo[khome]}" != "" ]]; then + bindkey "${terminfo[khome]}" beginning-of-line # [Home] - Go to beginning of line +fi +if [[ "${terminfo[kend]}" != "" ]]; then + bindkey "${terminfo[kend]}" end-of-line # [End] - Go to end of line +fi -bindkey ' ' magic-space # [Space] - do history expansion +bindkey ' ' magic-space # [Space] - do history expansion -bindkey '^[[1;5C' forward-word # [Ctrl-RightArrow] - move forward one word -bindkey '^[[1;5D' backward-word # [Ctrl-LeftArrow] - move backward one word +bindkey '^[[1;5C' forward-word # [Ctrl-RightArrow] - move forward one word +bindkey '^[[1;5D' backward-word # [Ctrl-LeftArrow] - move backward one word -bindkey "${terminfo[kcbt]}" reverse-menu-complete # [Shift-Tab] - move through the completion menu backwards +if [[ "${terminfo[kdch1]}" != "" ]]; then + bindkey "${terminfo[kdch1]}" reverse-menu-complete # [Shift-Tab] - move through the completion menu backwards +fi -bindkey '^?' backward-delete-char # [Backspace] - delete backward -bindkey "${terminfo[kdch1]}" delete-char # [Delete] - delete forward +bindkey '^?' backward-delete-char # [Backspace] - delete backward +if [[ "${terminfo[kdch1]}" != "" ]]; then + bindkey "${terminfo[kdch1]}" delete-char # [Delete] - delete forward +else + bindkey "^[[3~" delete-char + bindkey "^[3;5~" delete-char + bindkey "\e[3~" delete-char +fi # Edit the current command line in $EDITOR autoload -U edit-command-line diff --git a/plugins/atom/atom.plugin.zsh b/plugins/atom/atom.plugin.zsh index 048fd7521..9adb9031a 100644 --- a/plugins/atom/atom.plugin.zsh +++ b/plugins/atom/atom.plugin.zsh @@ -1,4 +1,14 @@ -# -# Your guess is as good as mine. Let's just assume that we will need this... -# - For more info visit... http://atom.io/ -# \ No newline at end of file +local _atom_paths > /dev/null 2>&1 +_atom_paths=( + "$HOME/Applications/Atom.app" + "/Applications/Atom.app" +) + +for _atom_path in $_atom_paths; do + if [[ -a $_atom_path ]]; then + alias at="open -a '$_atom_path'" + break + fi +done + +alias att='at .' diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh index b16a75c5b..32dd4b624 100644 --- a/plugins/battery/battery.plugin.zsh +++ b/plugins/battery/battery.plugin.zsh @@ -21,7 +21,7 @@ if [[ $(uname) == "Darwin" ]] ; then function plugged_in() { [ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ Yes') -eq 1 ] } - + function battery_pct_remaining() { if plugged_in ; then echo "External Power" @@ -31,7 +31,7 @@ if [[ $(uname) == "Darwin" ]] ; then } function battery_time_remaining() { - local smart_battery_status="$(ioreg -rc "AppleSmartBattery")" + local smart_battery_status="$(ioreg -rc "AppleSmartBattery")" if [[ $(echo $smart_battery_status | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then timeremaining=$(echo $smart_battery_status | grep '^.*"AvgTimeToEmpty"\ =\ ' | sed -e 's/^.*"AvgTimeToEmpty"\ =\ //') if [ $timeremaining -gt 720 ] ; then @@ -59,9 +59,9 @@ if [[ $(uname) == "Darwin" ]] ; then echo "∞" fi } - + function battery_is_charging() { - [[ $(ioreg -rc "AppleSmartBattery"| grep '^.*"IsCharging"\ =\ ' | sed -e 's/^.*"IsCharging"\ =\ //') == "Yes" ]] + [[ $(ioreg -rc "AppleSmartBattery"| grep '^.*"IsCharging"\ =\ ' | sed -e 's/^.*"IsCharging"\ =\ //') == "Yes" ]] } elif [[ $(uname) == "Linux" ]] ; then @@ -71,7 +71,9 @@ elif [[ $(uname) == "Linux" ]] ; then } function battery_pct() { - echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" + if (( $+commands[acpi] )) ; then + echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" + fi } function battery_pct_remaining() { @@ -103,7 +105,7 @@ elif [[ $(uname) == "Linux" ]] ; then echo "∞" fi } - + else # Empty functions so we don't cause errors in prompts function battery_pct_remaining() { @@ -136,7 +138,7 @@ function battery_level_gauge() { if [[ $battery_remaining_percentage =~ [0-9]+ ]]; then local filled=$(((( $battery_remaining_percentage + $gauge_slots - 1) / $gauge_slots))); local empty=$(($gauge_slots - $filled)); - + if [[ $filled -gt $green_threshold ]]; then local gauge_color=$color_green; elif [[ $filled -gt $yellow_threshold ]]; then local gauge_color=$color_yellow; else local gauge_color=$color_red; @@ -144,10 +146,9 @@ function battery_level_gauge() { else local filled=$gauge_slots; local empty=0; - filled_symbol=${BATTERY_UNKNOWN_SYMBOL:-'.'}; + filled_symbol=${BATTERY_UNKNOWN_SYMBOL:-'.'}; fi - local charging=' ' && battery_is_charging && charging=$charging_symbol; printf ${charging_color//\%/\%\%}$charging${color_reset//\%/\%\%}${battery_prefix//\%/\%\%}${gauge_color//\%/\%\%} diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index df30ed7c7..e4b03e7b0 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -6,7 +6,7 @@ alias bu="bundle update" # The following is based on https://github.com/gma/bundler-exec -bundled_commands=(annotate berks cap capify cucumber foodcritic foreman guard jekyll kitchen knife mailcatcher middleman nanoc rackup rainbows rake rspec ruby shotgun spec spin spork strainer tailor taps thin thor unicorn unicorn_rails puma) +bundled_commands=(annotate berks cap capify cucumber foodcritic foreman guard irb jekyll kitchen knife mailcatcher middleman nanoc puma rackup rainbows rake rspec ruby shotgun spec spin spork strainer tailor taps thin thor unicorn unicorn_rails) # Remove $UNBUNDLED_COMMANDS from the bundled_commands list for cmd in $UNBUNDLED_COMMANDS; do diff --git a/plugins/common-aliases/common-aliases.plugin.zsh b/plugins/common-aliases/common-aliases.plugin.zsh index 75899ca2c..b19650fee 100644 --- a/plugins/common-aliases/common-aliases.plugin.zsh +++ b/plugins/common-aliases/common-aliases.plugin.zsh @@ -71,7 +71,7 @@ if [ ${ZSH_VERSION//\./} -ge 420 ]; then _image_fts=(jpg jpeg png gif mng tiff tif xpm) for ft in $_image_fts ; do alias -s $ft=$XIVIEWER; done - _media_fts=(avi mpg mpeg ogm mp3 wav ogg ape rm mov mkv) + _media_fts=(ape avi flv mkv mov mp3 mpeg mpg ogg ogm rm wav webm) for ft in $_media_fts ; do alias -s $ft=mplayer ; done #read documents diff --git a/plugins/dirpersist/dirpersist.plugin.zsh b/plugins/dirpersist/dirpersist.plugin.zsh index 0f6d9f435..88d1129d4 100644 --- a/plugins/dirpersist/dirpersist.plugin.zsh +++ b/plugins/dirpersist/dirpersist.plugin.zsh @@ -1,39 +1,19 @@ -#!/bin/zsh -# -# Make the dirstack more persistant -# -# Add dirpersist to $plugins in ~/.zshrc to load -# +# Save dirstack history to .zdirs +# adapted from: +# github.com/grml/grml-etc-core/blob/master/etc/zsh/zshrc#L1547 -# $zdirstore is the file used to persist the stack -zdirstore=~/.zdirstore +DIRSTACKSIZE=${DIRSTACKSIZE:-20} +dirstack_file=${dirstack_file:-${HOME}/.zdirs} -dirpersistinstall () { - if grep 'dirpersiststore' ~/.zlogout > /dev/null; then - else - if read -q \?"Would you like to set up your .zlogout file for use with dirspersist? (y/n) "; then - echo "# Store dirs stack\n# See $ZSH/plugins/dirspersist.plugin.zsh\ndirpersiststore" >> ~/.zlogout - else - echo "If you don't want this message to appear, remove dirspersist from \$plugins" - fi - fi +if [[ -f ${dirstack_file} ]] && [[ ${#dirstack[*]} -eq 0 ]] ; then + dirstack=( ${(f)"$(< $dirstack_file)"} ) + # "cd -" won't work after login by just setting $OLDPWD, so + [[ -d $dirstack[1] ]] && cd $dirstack[1] && cd $OLDPWD +fi + +chpwd() { + if (( $DIRSTACKSIZE <= 0 )) || [[ -z $dirstack_file ]]; then return; fi + local -ax my_stack + my_stack=( ${PWD} ${dirstack} ) + builtin print -l ${(u)my_stack} >! ${dirstack_file} } - -dirpersiststore () { - dirs -p | perl -e 'foreach (reverse ) {chomp;s/([& ])/\\$1/g ;print "if [ -d $_ ]; then pushd -q $_; fi\n"}' > $zdirstore -} - -dirpersistrestore () { - if [ -f $zdirstore ]; then - source $zdirstore - fi -} - -DIRSTACKSIZE=10 -setopt autopushd pushdminus pushdsilent pushdtohome pushdignoredups - -dirpersistinstall -dirpersistrestore - -# Make popd changes permanent without having to wait for logout -alias popd="popd;dirpersiststore" diff --git a/plugins/gas/_gas b/plugins/gas/_gas index befdc9459..23e6d99aa 100644 --- a/plugins/gas/_gas +++ b/plugins/gas/_gas @@ -13,6 +13,7 @@ case $state in cmds=( "version:Prints Gas's version" "use:Uses author" + "ssh:Creates a new ssh key for an existing gas author" "show:Shows your current user" "list:Lists your authors" "import:Imports current user to gasconfig" @@ -25,8 +26,12 @@ case $state in args) case $line[1] in (use|delete) - _values -S , 'authors' $(cat ~/.gas | sed -n -e 's/^\[\(.*\)\]/\1/p') && ret=0 - ;; + VERSION=$(gas -v) + if [[ $VERSION == <1->.*.* ]] || [[ $VERSION == 0.<2->.* ]] || [[ $VERSION == 0.1.<6-> ]] then + _values -S , 'authors' $(cat ~/.gas/gas.authors | sed -n -e 's/^.*\[\(.*\)\]/\1/p') && ret=0 + else + _values -S , 'authors' $(cat ~/.gas | sed -n -e 's/^\[\(.*\)\]/\1/p') && ret=0 + fi esac ;; esac diff --git a/plugins/gem/_gem b/plugins/gem/_gem index 66c77b7d1..25967f1e7 100644 --- a/plugins/gem/_gem +++ b/plugins/gem/_gem @@ -56,6 +56,9 @@ if (( CURRENT == 1 )); then fi case "$words[1]" in + build) + _files -g "*.gemspec" + ;; list) if [[ "$state" == forms ]]; then _gem_installed diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 2b5983f33..9f7819df3 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -149,7 +149,7 @@ function work_in_progress() { fi } # these alias commit and uncomit wip branches -alias gwip='git add -A; git ls-files --deleted -z | xargs -0 git rm; git commit -m "--wip--"' +alias gwip='git add -A; git ls-files --deleted -z | xargs -r0 git rm; git commit -m "--wip--"' alias gunwip='git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1' # these alias ignore changes to file diff --git a/plugins/glassfish/_asadmin b/plugins/glassfish/_asadmin new file mode 100644 index 000000000..a6a7af549 --- /dev/null +++ b/plugins/glassfish/_asadmin @@ -0,0 +1,1150 @@ +#compdef asadmin +#autoload + +local -a _1st_arguments +_1st_arguments=( + "add-library:adds one or more library JAR files to GlassFish Server" + "add-resources:creates the resources specified in an XML file" + "apply-http-lb-changes:applies load balancer configuration changes to the load balancer" + "backup-domain:performs a backup on the domain" + "change-admin-password:changes the administrator password" + "change-master-broker:changes the master broker in a Message Queue cluster providing JMS services for a GlassFish Server cluster." + "change-master-password:changes the master password" + "collect-log-files:creates a ZIP archive of all available log files" + "configure-jms-cluster:configures the Message Queue cluster providing JMS services to a GlassFish Server cluster" + "configure-lb-weight:sets load balancing weights for clustered instances" + "configure-ldap-for-admin:configures the authentication realm named admin-realm for the given LDAP" + "copy-config:copies an existing named configuration to create another configuration" + "create-admin-object:adds the administered object with the specified JNDI name for a resource adapter" + "create-application-ref:creates a reference to an application" + "create-audit-module:adds an audit module" + "create-auth-realm:adds the named authentication realm" + "create-cluster:creates a GlassFish Server cluster" + "create-connector-connection-pool:adds a connection pool with the specified connection pool name" + "create-connector-resource:registers the connector resource with the specified JNDI name" + "create-connector-security-map:creates a security map for the specified connector connection pool" + "create-connector-work-security-map:creates a work security map for the specified resource adapter" + "create-custom-resource:creates a custom resource" + "create-domain:creates a domain" + "create-file-user:creates a new file user" + "create-http:sets HTTP parameters for a protocol" + "create-http-health-checker:creates a health-checker for a specified load balancer configuration" + "create-http-lb:creates a load balancer" + "create-http-lb-config:creates a configuration for the load balancer" + "create-http-lb-ref:adds an existing cluster or server instance to an existing load balancer configuration or load balancer" + "create-http-listener:adds a new HTTP network listener socket" + "create-http-redirect:adds a new HTTP redirect" + "create-iiop-listener:adds an IIOP listener" + "create-instance:creates a GlassFish Server instance" + "create-jacc-provider:enables administrators to create a JACC provider that can be used by third-party authorization modules for applications running in GlassFish Server" + "create-javamail-resource:creates a JavaMail session resource" + "create-jdbc-connection-pool:registers a JDBC connection pool" + "create-jdbc-resource:creates a JDBC resource with the specified JNDI name" + "create-jms-host:creates a JMS host" + "create-jms-resource:creates a JMS resource" + "create-jmsdest:creates a JMS physical destination" + "create-jndi-resource:registers a JNDI resource" + "create-jvm-options:creates options for the Java application launcher" + "create-lifecycle-module:creates a lifecycle module" + "create-local-instance:creates a GlassFish Server instance on the host where the subcommand is run" + "create-message-security-provider:enables administrators to create a message security provider, which specifies how SOAP messages will be secured." + "create-network-listener:adds a new network listener socket" + "create-node-config:creates a node that is not enabled for remote communication" + "create-node-dcom:creates a node that is enabled for com munication over DCOM" + "create-node-ssh:creates a node that is enabled for communication over SSH" + "create-password-alias:creates a password alias" + "create-profiler:creates the profiler element" + "create-protocol:adds a new protocol" + "create-protocol-filter:adds a new protocol filter" + "create-protocol-finder:adds a new protocol finder" + "create-resource-adapter-config:creates the configuration information for the connector module" + "create-resource-ref:creates a reference to a resource" + "create-service:configures the starting of a DAS or a GlassFish Server instance on an unattended boot" + "create-ssl:creates and configures the SSL element in the selected HTTP listener, IIOP listener, or IIOP service" + "create-system-properties:adds one or more system property elements that can be referenced elsewhere in the configuration." + "create-threadpool:adds a thread pool" + "create-transport:adds a new transport" + "create-virtual-server:creates the named virtual server" + "delete-admin-object:removes the administered object with the specified JNDI name." + "delete-application-ref:removes a reference to an applica tion" + "delete-audit-module:removes the named audit-module" + "delete-auth-realm:removes the named authentication realm" + "delete-cluster:deletes a GlassFish Server cluster" + "delete-config:deletes an existing named configuration" + "delete-connector-connection-pool:removes the specified connector connection pool" + "delete-connector-resource:removes the connector resource with the specified JNDI name" + "delete-connector-security-map:deletes a security map for the specified connector connection pool" + "delete-connector-work-security-map:deletes a work security map for the specified resource adapter" + "delete-custom-resource:removes a custom resource" + "delete-domain:deletes a domain" + "delete-file-user:removes the named file user" + "delete-http:removes HTTP parameters from a protocol" + "delete-http-health-checker:deletes the health-checker for a specified load balancer configuration" + "delete-http-lb:deletes a load balancer" + "delete-http-lb-config:deletes a load balancer configuration" + "delete-http-lb-ref:deletes the cluster or server instance from a load balancer" + "delete-http-listener:removes a network listener" + "delete-http-redirect:removes an HTTP redirect" + "delete-iiop-listener:removes an IIOP listener" + "delete-instance:deletes a GlassFish Server instance" + "delete-jacc-provider:enables administrators to delete JACC providers defined for a domain" + "delete-javamail-resource:removes a JavaMail session resource" + "delete-jdbc-connection-pool:removes the specified JDBC connection pool" + "delete-jdbc-resource:removes a JDBC resource with the specified JNDI name" + "delete-jms-host:removes a JMS host" + "delete-jms-resource:removes a JMS resource" + "delete-jmsdest:removes a JMS physical destination" + "delete-jndi-resource:removes a JNDI resource" + "delete-jvm-options:removes one or more options for the Java application launcher" + "delete-lifecycle-module:removes the lifecycle module" + "delete-local-instance:deletes a GlassFish Server instance on the machine where the subcommand is run" + "delete-log-levels:" + "delete-message-security-provider:enables administrators to delete a message security provider" + "delete-network-listener:removes a network listener" + "delete-node-config:deletes a node that is not enabled for remote communication" + "delete-node-dcom:deletes a node that is enabled for communication over DCOM" + "delete-node-ssh:deletes a node that is enabled for communication over SSH" + "delete-password-alias:deletes a password alias" + "delete-profiler:removes the profiler element" + "delete-protocol:removes a protocol" + "delete-protocol-filter:removes a protocol filter" + "delete-protocol-finder:removes a protocol finder" + "delete-resource-adapter-config:deletes the resource adapter configuration" + "delete-resource-ref:removes a reference to a resource" + "delete-ssl:deletes the SSL element in the selected HTTP listener, IIOP listener, or IIOP service" + "delete-system-property:removes a system property of the domain, configuration, cluster, or server instance, one at a time" + "delete-threadpool:removes a thread pool" + "delete-transport:removes a transport" + "delete-virtual-server:removes a virtual server" + "deploy:deploys the specified component" + "deploydir:deploys an exploded format of application archive" + "environment variable" + "disable:disables the component" + "disable-http-lb-application:disables an application managed by a load balancer" + "disable-http-lb-server:disables a sever or cluster managed by a load balancer" + "disable-monitoring:disables monitoring for the server or for specific monitorable modules" + "disable-secure-admin:disables secure admin if it is already enabled." + "disable-secure-admin-internal-user:Instructs the GlassFish Server DAS and instances to not use the specified admin user to authenticate with each other and to authorize admin operations." + "disable-secure-admin-principal:disables the certificate for authorizing access in secure administration." + "enable:enables the component" + "enable-http-lb-application:enables a previously-disabled application managed by a load balancer" + "enable-http-lb-server:enables a previously disabled sever or cluster managed by a load balancer" + "enable-monitoring:enables monitoring for the server or for specific monitorable modules" + "enable-secure-admin:enables secure admin (if it is not already enabled), optionally changing the alias used for DAS-to-instance admin messages or the alias used for instance-to-DAS admin messages." + "enable-secure-admin-internal-user:Instructs the GlassFish Server DAS and instances to use the specified admin user and the password associated with the password alias to authenticate with each other and to authorize admin operations." + "enable-secure-admin-principal:Instructs GlassFish Server, when secure admin is enabled, to accept admin requests from clients identified by the specified SSL certificate." + "export:marks a variable name for automatic export to the environment of subsequent commands in multimode" + "export-http-lb-config:exports the load balancer configuration or load balancer to a file" + "export-sync-bundle:exports the configuration data of a cluster or standalone instance to an archive file" + "flush-connection-pool:reintializes all connections established in the specified connection pool" + "flush-jmsdest:purges messages in a JMS destination." + "freeze-transaction-service:freezes the transaction subsystem" + "generate-domain-schema:" + "generate-jvm-report:shows the JVM machine statistics for a given target instance" + "get:gets the values of configurable or monitorable attributes" + "get-client-stubs:retrieves the application JAR files needed to launch the application client." + "get-health:provides information on the cluster health" + "help" + "asadmin:utility for performing administrative tasks for Oracle GlassFish Server" + "import-sync-bundle:imports the configuration data of a clustered instance or standalone instance from an archive file" + "install-node:installs GlassFish Server software on specified SSH-enabled hosts" + "install-node-dcom:installs GlassFish Server software on specified DCOM-enabled hosts" + "install-node-ssh:installs GlassFish Server software on specified SSH-enabled hosts" + "jms-ping:checks if the JMS service is up and running" + "list:lists configurable or monitorable elements" + "list-admin-objects:gets all the administered objects" + "list-application-refs:lists the existing application references" + "list-applications:lists deployed applications" + "list-audit-modules:gets all audit modules and displays them" + "list-auth-realms:lists the authentication realms" + "list-backups:lists all backups" + "list-clusters:lists existing clusters in a domain" + "list-commands:lists available commands" + "list-components:lists deployed components" + "list-configs:lists named configurations" + "list-connector-connection-pools:lists the existing connector connection pools" + "list-connector-resources:lists all connector resources" + "list-connector-security-maps:lists the security maps belonging to the specified connector connection pool" + "list-connector-work-security-maps:lists the work security maps belonging to the specified resource adapter" + "list-containers:lists application containers" + "list-custom-resources:gets all custom resources" + "list-domains:lists the domains in the specified directory" + "list-file-groups:lists file groups" + "list-file-users:lists the file users" + "list-http-lb-configs:lists load balancer configurations" + "list-http-lbs:lists load balancers" + "list-http-listeners:lists the existing network listeners" + "list-iiop-listeners:lists the existing IIOP listeners" + "list-instances:lists GlassFish Server instances in a domain" + "list-jacc-providers:enables administrators to list JACC providers defined for a domain" + "list-javamail-resources:lists the existing JavaMail session resources" + "list-jdbc-connection-pools:lists all JDBC connection pools" + "list-jdbc-resources:lists all JDBC resources" + "list-jms-hosts:lists the existing JMS hosts" + "list-jms-resources:lists the JMS resources" + "list-jmsdest:lists the existing JMS physical destinations" + "list-jndi-entries:browses and queries the JNDI tree" + "list-jndi-resources:lists all existing JNDI resources" + "list-jvm-options:lists options for the Java application launcher" + "list-libraries:lists library JAR files on GlassFish Server" + "list-lifecycle-modules:lists the lifecycle modules" + "list-log-attributes:lists all logging attributes defined for a specified target in a domain" + "list-log-levels:lists the loggers and their log levels" + "list-message-security-providers:lists all security message providers for the given message layer" + "list-modules:lists GlassFish Server modules" + "list-network-listeners:lists the existing network listeners" + "list-nodes:lists all GlassFish Server nodes in a domain" + "list-nodes-config:lists all GlassFish Server nodes that do not support remote communication in a domain" + "list-nodes-dcom:lists all GlassFish Server nodes that support communication over DCOM in a domain" + "list-nodes-ssh:lists all GlassFish Server nodes that support communication over SSH in a domain" + "list-password-aliases:lists all password aliases" + "list-persistence-types:lists registered persistence types for HTTP sessions and SFSB instances" + "list-protocol-filters:lists the existing protocol filters" + "list-protocol-finders:lists the existing protocol finders" + "list-protocols:lists the existing protocols" + "list-resource-adapter-configs:lists the names of the current resource adapter configurations" + "list-resource-refs:lists existing resource references" + "list-secure-admin-internal-users:lists the user names that the GlassFish Server DAS and instances use to authenticate with each other and to authorize admin operations." + "list-secure-admin-principals:lists the certificates for which GlassFish Server accepts admin requests from clients." + "list-sub-components:lists EJB or servlet components in a deployed module or module of a deployed application" + "list-supported-cipher-suites:enables administrators to list the cipher suites that are supported and available to a specified GlassFish Server target" + "list-system-properties:lists the system properties of the domain, configuration, cluster, or server instance" + "list-threadpools:lists all the thread pools" + "list-timers:lists all of the persistent timers owned by server instance(s)" + "list-transports:lists the existing transports" + "list-virtual-servers:lists the existing virtual servers" + "list-web-context-param:lists servlet contextinitialization parameters of a deployed web application or module" + "list-web-env-entry:lists environment entries for a deployed web application or module" + "login:logs you into a domain" + "migrate-timers:moves EJB timers when a clustered instance was stopped or has crashed" + "monitor:displays monitoring data for commonly used components and services" + "multimode:allows multiple subcommands to be run while preserving environment settings and remaining in the asadmin utility" + "ping-connection-pool:tests if a connection pool is usable" + "ping-node-dcom:tests if a node that is enabled for communication over DCOM is usable" + "ping-node-ssh:tests if a node that is enabled for communication over SSH is usable" + "recover-transactions:manually recovers pending transactions" + "redeploy:redeploys the specified component" + "remove-library:removes one or more library JAR files from GlassFish Server" + "restart-domain:restarts the DAS of the specified domain" + "restart-instance:restarts a running GlassFish Server instance" + "restart-local-instance:restarts a running GlassFish Server instance on the host where the subcommand is run" + "restore-domain:restores files from backup" + "rollback-transaction:rolls back the named transaction" + "rotate-log:rotates the log file" + "set:sets the values of configurable attributes" + "set-log-attributes:sets the logging attributes for one or more loggers" + "set-log-levels:sets the log level for one or more loggers" + "set-web-context-param:sets a servlet context initialization parameter of a deployed web application or module" + "set-web-env-entry:sets an environment entry for a deployed web application or module" + "setup-ssh:sets up an SSH key on specified hosts" + "show-component-status:displays the status of the deployed component" + "start-cluster:starts a cluster" + "start-database:starts the Java DB" + "start-domain:starts the DAS of the specified domain" + "start-instance:starts a GlassFish Server instance" + "start-local-instance:starts a GlassFish Server instance on the host where the subcommand is run" + "stop-cluster:stops a GlassFish Server cluster" + "stop-database:stops the Java DB" + "stop-domain:stops the Domain Administration Server of the specified domain" + "stop-instance:stops a running GlassFish Server instance" + "stop-local-instance:stops a GlassFish Server instance on the machine where the subcommand is run" + "undeploy:removes a deployed component" + "unfreeze-transaction-service:resumes all suspended transactions" + "uninstall-node:uninstalls GlassFish Server software from specified hosts" + "uninstall-node-dcom:uninstalls GlassFish Server software from specified DCOM-enabled hosts" + "uninstall-node-ssh:uninstalls GlassFish Server software from specified SSH-enabled hosts" + "unset:removes one or more variables from the multimode environment" + "unset-web-context-param:unsets a servlet context initialization parameter of a deployed web application or module" + "unset-web-env-entry:unsets an environment entry for a deployed web application or module" + "update-connector-security-map:modifies a security map for the specified connector connection pool" + "update-connector-work-security-map:modifies a work security map for the specified resource adapter" + "update-file-user:updates a current file user as specified" + "update-node-config:updates the configuration data of anode" + "update-node-dcom:updates the configuration data of a node" + "update-node-ssh:updates the configuration data of a node" + "update-password-alias:updates a password alias" + "uptime:returns the length of time that the DAS has been running" + "validate-dcom:tests the connection over DCOM to a remote host" + "validate-multicast:validates that multicast transport is available for clusters" + "verify-domain-xml:verifies the content of the domain.xml file" + "version:displays version information forGlassFish Server" +) + +_arguments '*:: :->command' + +if (( CURRENT == 1 )); then + _describe -t commands "asadmin command" _1st_arguments + return +fi + +local -a _command_args +case "$words[1]" in + add-library) + _command_args=('*:directory:_files' '--host+:' '--port+:' '--type+:type:(common ext app)') + ;; + add-resources) + _command_args=('*:directory:_files' '--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_das_domain_standalone_instance') + ;; + apply-http-lb-changes) + _command_args=('--host+:' '--ping+:' '--port+:') + ;; + backup-domain) + _command_args=('--backupconfig+:' '--backupdir+:' '--description+:' '--domaindir+:' '--long+:long:(true false)') + ;; + change-admin-password) + _command_args=('--domain_name+:' '--domaindir+:') + ;; + change-master-broker) + _command_args=('--host+:' '--port+:') + ;; + change-master-password) + _command_args=('--domaindir+:' '--nodedir+:' '--savemasterpassword+:savemasterpassword:(true false)') + ;; + collect-log-files) + _command_args=('--host+:' '--port+:' '--retrieve+:retrieve:(true false)' '--target+:') + ;; + configure-jms-cluster) + _command_args=('--clustertype+:' '--configstoretype+:' '--dburl+:' '--dbuser+:' '--dbvendor+:' '--host+:' '--jmsdbpassword+:' '--messagestoretype+:' '--port+:' '--property+:') + ;; + configure-lb-weight) + _command_args=('--cluster+:cluster:_asadmin_clusters' '--host+:' '--port+:') + ;; + configure-ldap-for-admin) + _command_args=('--basedn+:' '--host+:' '--ldap-group+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance' '--url+:') + ;; + copy-config) + _command_args=('--host+:' '--port+:' '--systemproperties+:') + ;; + create-admin-object) + _command_args=('--classname+:' '--description+:' '--enabled+:enabled:(true false)' '--host+:' '--port+:' '--property+:' '--raname+:' '--restype+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + create-application-ref) + _command_args=('--enabled+:enabled:(true false)' '--host+:' '--lbenabled+:lbenabled:(true false)' '--port+:' '--target+:target:_asadmin_targets_cluster_das_standalone_instance' '--virtualservers+:') + ;; + create-audit-module) + _command_args=('--classname+:' '--host+:' '--port+:' '--property+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + create-auth-realm) + _command_args=('--classname+:' '--host+:' '--port+:' '--property+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + create-connector-connection-pool) + _command_args=('--associatewiththread+:associatewiththread:(true false)' '--connectiondefinition+:' '--creationretryattempts+:' '--creationretryinterval+:' '--description+:' '--failconnection+:failconnection:(true false)' '--host+:' '--idletimeout+:' '--isconnectvalidatereq+:isconnectvalidatereq:(true false)' '--lazyconnectionassociation+:lazyconnectionassociation:(true false)' '--lazyconnectionenlistment+:lazyconnectionenlistment:(true false)' '--leakreclaim+:leakreclaim:(true false)' '--leaktimeout+:' '--matchconnections+:matchconnections:(true false)' '--maxconnectionusagecount+:' '--maxpoolsize+:' '--maxwait+:' '--ping+:ping:(true false)' '--pooling+:pooling:(true false)' '--poolresize+:' '--port+:' '--property+:' '--raname+:' '--steadypoolsize+:' '--target+:' '--transactionsupport+:transactionsupport:(XATransaction LocalTransaction NoTransaction)' '--validateatmostonceperiod+:') + ;; + create-connector-resource) + _command_args=('--description+:' '--enabled+:enabled:(true false)' '--host+:' '--objecttype+:' '--poolname+:' '--port+:' '--property+:' '--target+:target:_asadmin_targets_cluster_das_domain_standalone_instance') + ;; + create-connector-security-map) + _command_args=('--host+:' '--mappedpassword+:' '--mappedusername+:' '--poolname+:' '--port+:' '--principals+:' '--target+:' '--usergroups+:') + ;; + create-connector-work-security-map) + _command_args=('--description+:' '--groupsmap+:' '--host+:' '--port+:' '--principalsmap+:' '--raname+:') + ;; + create-custom-resource) + _command_args=('--description+:' '--enabled+:enabled:(true false)' '--factoryclass+:' '--host+:' '--port+:' '--property+:' '--restype+:' '--target+:target:_asadmin_targets_cluster_das_domain_standalone_instance') + ;; + create-domain) + _command_args=('--adminport+:' '--checkports+:checkports:(true false)' '--domaindir+:' '--domainproperties+:' '--instanceport+:' '--keytooloptions+:' '--nopassword+:nopassword:(true false)' '--portbase+:' '--profile+:' '--savelogin+:savelogin:(true false)' '--savemasterpassword+:savemasterpassword:(true false)' '--template+:' '--usemasterpassword+:usemasterpassword:(true false)') + ;; + create-file-user) + _command_args=('--authrealmname+:' '--groups+:' '--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance' '--userpassword+:') + ;; + create-http) + _command_args=('--default-virtual-server+:' '--dns-lookup-enabled+:dns-lookup-enabled:(true false)' '--host+:' '--max-connection+:' '--port+:' '--request-timeout-seconds+:' '--servername+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance' '--timeout-seconds+:' '--xpowered+:xpowered:(true false)') + ;; + create-http-health-checker) + _command_args=('--config+:' '--host+:' '--interval+:' '--port+:' '--timeout+:' '--url+:') + ;; + create-http-lb) + _command_args=('--autoapplyenabled+:autoapplyenabled:(true false)' '--devicehost+:' '--deviceport+:' '--healthcheckerinterval+:' '--healthcheckertimeout+:' '--healthcheckerurl+:' '--host+:' '--httpsrouting+:httpsrouting:(true false)' '--lbenableallapplications+:' '--lbenableallinstances+:' '--lbpolicy+:' '--lbpolicymodule+:' '--lbweight+:' '--monitor+:monitor:(true false)' '--port+:' '--property+:' '--reloadinterval+:' '--responsetimeout+:' '--routecookie+:routecookie:(true false)' '--sslproxyhost+:' '--sslproxyport+:' '--target+:target:_asadmin_targets_cluster_standalone_instance') + ;; + create-http-lb-ref) + _command_args=('--config+:' '--healthcheckerinterval+:' '--healthcheckertimeout+:' '--healthcheckerurl+:' '--host+:' '--lbenableallapplications+:' '--lbenableallinstances+:' '--lbname+:' '--lbpolicy+:' '--lbpolicymodule+:' '--lbweight+:' '--port+:') + ;; + create-http-listener) + _command_args=('--acceptorthreads+:' '--default-virtual-server+:' '--defaultvs+:' '--enabled+:enabled:(true false)' '--host+:' '--listeneraddress+:' '--listenerport+:' '--port+:' '--redirectport+:' '--secure+:secure:(true false)' '--securityenabled+:securityenabled:(true false)' '--servername+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance' '--xpowered+:xpowered:(true false)') + ;; + create-http-redirect) + _command_args=('--host+:' '--port+:' '--redirect-port+:' '--secure-redirect+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + create-iiop-listener) + _command_args=('--enabled+:enabled:(true false)' '--host+:' '--iiopport+:' '--listeneraddress+:' '--port+:' '--property+:' '--securityenabled+:securityenabled:(true false)' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + create-instance) + _command_args=('--checkports+:checkports:(true false)' '--cluster+:cluster:_asadmin_clusters' '--config+:' '--host+:' '--lbenabled+:lbenabled:(true false)' '--node+:node:_asadmin_nodes' '--port+:' '--portbase+:' '--systemproperties+:' '--terse+:terse:(true false)') + ;; + create-jacc-provider) + _command_args=('--host+:' '--policyconfigfactoryclass+:' '--policyproviderclass+:' '--port+:' '--property+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + create-javamail-resource) + _command_args=('--debug+:debug:(true false)' '--description+:' '--enabled+:enabled:(true false)' '--fromaddress+:' '--host+:' '--mailhost+:' '--mailuser+:' '--port+:' '--property+:' '--storeprotocol+:' '--storeprotocolclass+:' '--target+:target:_asadmin_targets_cluster_das_domain_standalone_instance' '--transprotocol+:' '--transprotocolclass+:') + ;; + create-jdbc-connection-pool) + _command_args=('--allownoncomponentcallers+:allownoncomponentcallers:(true false)' '--associatewiththread+:associatewiththread:(true false)' '--creationretryattempts+:' '--creationretryinterval+:' '--datasourceclassname+:' '--description+:' '--driverclassname+:' '--failconnection+:failconnection:(true false)' '--host+:' '--idletimeout+:' '--initsql+:' '--isconnectvalidatereq+:isconnectvalidatereq:(true false)' '--isisolationguaranteed+:isisolationguaranteed:(true false)' '--isolationlevel+:' '--lazyconnectionassociation+:lazyconnectionassociation:(true false)' '--lazyconnectionenlistment+:lazyconnectionenlistment:(true false)' '--leakreclaim+:leakreclaim:(true false)' '--leaktimeout+:' '--matchconnections+:matchconnections:(true false)' '--maxconnectionusagecount+:' '--maxpoolsize+:' '--maxwait+:' '--nontransactionalconnections+:nontransactionalconnections:(true false)' '--ping+:ping:(true false)' '--pooling+:pooling:(true false)' '--poolresize+:' '--port+:' '--property+:' '--restype+:restype:(javax.sql.DataSource javax.sql.XADataSource javax.sql.ConnectionPoolDataSource java.sql.Driver)' '--sqltracelisteners+:' '--statementcachesize+:' '--statementleakreclaim+:statementleakreclaim:(true false)' '--statementleaktimeout+:' '--statementtimeout+:' '--steadypoolsize+:' '--target+:' '--validateatmostonceperiod+:' '--validationclassname+:' '--validationmethod+:validationmethod:(auto-commit meta-data table custom-validation)' '--validationtable+:' '--wrapjdbcobjects+:wrapjdbcobjects:(true false)') + ;; + create-jdbc-resource) + _command_args=('--connectionpoolid+:' '--description+:' '--enabled+:enabled:(true false)' '--host+:' '--port+:' '--property+:' '--target+:target:_asadmin_targets_cluster_das_domain_standalone_instance') + ;; + create-jms-host) + _command_args=('--host+:' '--mqhost+:' '--mqpassword+:' '--mqport+:' '--mquser+:' '--port+:' '--property+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + create-jms-resource) + _command_args=('--description+:' '--enabled+:enabled:(true false)' '--host+:' '--port+:' '--property+:' '--restype+:' '--target+:target:_asadmin_targets_cluster_das_domain_standalone_instance') + ;; + create-jmsdest) + _command_args=('--desttype+:' '--host+:' '--port+:' '--property+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + create-jndi-resource) + _command_args=('--description+:' '--enabled+:enabled:(true false)' '--factoryclass+:' '--host+:' '--jndilookupname+:' '--port+:' '--property+:' '--restype+:' '--target+:target:_asadmin_targets_cluster_das_domain_standalone_instance') + ;; + create-jvm-options) + _command_args=('--host+:' '--port+:' '--profiler+:profiler:(true false)' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + create-lifecycle-module) + _command_args=('--classname+:' '--classpath+:' '--description+:' '--enabled+:enabled:(true false)' '--failurefatal+:failurefatal:(true false)' '--host+:' '--loadorder+:' '--port+:' '--property+:' '--target+:target:_asadmin_targets_cluster_das_domain_standalone_instance') + ;; + create-local-instance) + _command_args=('--checkports+:checkports:(true false)' '--cluster+:cluster:_asadmin_clusters' '--config+:' '--lbenabled+:lbenabled:(true false)' '--node+:node:_asadmin_nodes' '--nodedir+:' '--portbase+:' '--savemasterpassword+:savemasterpassword:(true false)' '--systemproperties+:' '--usemasterpassword+:usemasterpassword:(true false)') + ;; + create-message-security-provider) + _command_args=('--classname+:' '--host+:' '--isdefaultprovider+:isdefaultprovider:(true false)' '--layer+:layer:(SOAP HttpServlet)' '--port+:' '--property+:' '--providertype+:providertype:(client server client-server)' '--requestauthrecipient+:' '--requestauthsource+:' '--responseauthrecipient+:' '--responseauthsource+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + create-network-listener) + _command_args=('--address+:' '--enabled+:enabled:(true false)' '--host+:' '--jkenabled+:jkenabled:(true false)' '--listenerport+:' '--port+:' '--protocol+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance' '--threadpool+:' '--transport+:') + ;; + create-node-config) + _command_args=('--host+:' '--installdir+:' '--nodedir+:' '--nodehost+:' '--port+:') + ;; + create-node-dcom) + _command_args=('--archive+:' '--force+:force:(true false)' '--host+:' '--install+:install:(true false)' '--installdir+:' '--nodedir+:' '--nodehost+:' '--port+:' '--windowsdomain+:' '--windowspassword+:' '--windowsuser+:') + ;; + create-node-ssh) + _command_args=('--archive+:' '--force+:force:(true false)' '--host+:' '--install+:install:(true false)' '--installdir+:' '--nodedir+:' '--nodehost+:' '--port+:' '--sshkeyfile+:' '--sshkeypassphrase+:' '--sshpassword+:' '--sshport+:' '--sshuser+:') + ;; + create-password-alias) + _command_args=('--aliaspassword+:' '--host+:' '--port+:') + ;; + create-profiler) + _command_args=('--classpath+:' '--enabled+:enabled:(true false)' '--host+:' '--nativelibrarypath+:' '--port+:' '--property+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + create-protocol) + _command_args=('--host+:' '--port+:' '--securityenabled+:securityenabled:(true false)' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + create-protocol-filter) + _command_args=('--classname+:' '--host+:' '--port+:' '--protocol+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + create-protocol-finder) + _command_args=('--classname+:' '--host+:' '--port+:' '--protocol+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance' '--targetprotocol+:') + ;; + create-resource-adapter-config) + _command_args=('--host+:' '--objecttype+:' '--port+:' '--property+:' '--target+:' '--threadpoolid+:') + ;; + create-resource-ref) + _command_args=('--enabled+:enabled:(true false)' '--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_das_standalone_instance') + ;; + create-service) + _command_args=('*:instances:_asadmin_instances' '--domaindir+:domaindir:directory:_files' '--dry-run+:dry-run:(true false)' '--force+:force:(true false)' '--name+:' '--node+:node:_asadmin_nodes' '--nodedir+:' '--serviceproperties+:' '--serviceuser+:') + ;; + create-ssl) + _command_args=('--certname+:' '--clientauthenabled+:clientauthenabled:(true false)' '--host+:' '--port+:' '--ssl2ciphers+:' '--ssl2enabled+:ssl2enabled:(true false)' '--ssl3enabled+:ssl3enabled:(true false)' '--ssl3tlsciphers+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance' '--tlsenabled+:tlsenabled:(true false)' '--tlsrollbackenabled+:tlsrollbackenabled:(true false)' '--type+:type:(network-listener http-listener iiop-listener iiop-service jmx-connector)') + ;; + create-system-properties) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_clustered_instance_config_das_domain_standalone_instance') + ;; + create-threadpool) + _command_args=('--host+:' '--idletimeout+:' '--maxqueuesize+:' '--maxthreadpoolsize+:' '--minthreadpoolsize+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance' '--workqueues+:') + ;; + create-transport) + _command_args=('--acceptorthreads+:' '--buffersizebytes+:' '--bytebuffertype+:' '--classname+:' '--displayconfiguration+:displayconfiguration:(true false)' '--enablesnoop+:enablesnoop:(true false)' '--host+:' '--idlekeytimeoutseconds+:' '--maxconnectionscount+:' '--port+:' '--readtimeoutmillis+:' '--selectionkeyhandler+:' '--selectorpolltimeoutmillis+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance' '--tcpnodelay+:tcpnodelay:(true false)' '--writetimeoutmillis+:') + ;; + create-virtual-server) + _command_args=('--defaultwebmodule+:' '--host+:' '--hosts+:' '--httplisteners+:' '--logfile+:' '--networklisteners+:' '--port+:' '--property+:' '--state+:state:(on off disabled)' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + delete-admin-object) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + delete-application-ref) + _command_args=('--cascade+:cascade:(true false)' '--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_das_standalone_instance') + ;; + delete-audit-module) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + delete-auth-realm) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + delete-config) + _command_args=('--host+:' '--port+:') + ;; + delete-connector-connection-pool) + _command_args=('--cascade+:cascade:(true false)' '--host+:' '--port+:' '--target+:') + ;; + delete-connector-resource) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_das_domain_standalone_instance') + ;; + delete-connector-security-map) + _command_args=('--host+:' '--poolname+:' '--port+:' '--target+:') + ;; + delete-connector-work-security-map) + _command_args=('--host+:' '--port+:' '--raname+:') + ;; + delete-custom-resource) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_das_domain_standalone_instance') + ;; + delete-domain) + _command_args=('--domaindir+:') + ;; + delete-file-user) + _command_args=('--authrealmname+:' '--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + delete-http) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + delete-http-health-checker) + _command_args=('--config+:' '--host+:' '--port+:') + ;; + delete-http-lb-ref) + _command_args=('--config+:' '--force+:' '--host+:' '--lbname+:' '--port+:') + ;; + delete-http-listener) + _command_args=('--host+:' '--port+:' '--secure+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + delete-http-redirect) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + delete-iiop-listener) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + delete-instance) + _command_args=('*:instances:_asadmin_instances' '--host+:' '--port+:' '--terse+:terse:(true false)') + ;; + delete-jacc-provider) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + delete-javamail-resource) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_das_domain_standalone_instance') + ;; + delete-jdbc-connection-pool) + _command_args=('--cascade+:cascade:(true false)' '--host+:' '--port+:' '--target+:') + ;; + delete-jdbc-resource) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_das_domain_standalone_instance') + ;; + delete-jms-host) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + delete-jms-resource) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_das_domain_standalone_instance') + ;; + delete-jmsdest) + _command_args=('--desttype+:' '--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + delete-jndi-resource) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_das_domain_standalone_instance') + ;; + delete-jvm-options) + _command_args=('--host+:' '--port+:' '--profiler+:profiler:(true false)' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + delete-lifecycle-module) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_das_domain_standalone_instance') + ;; + delete-local-instance) + _command_args=('*:instances:_asadmin_instances' '--node+:node:_asadmin_nodes' '--nodedir+:') + ;; + delete-log-levels) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + delete-message-security-provider) + _command_args=('--host+:' '--layer+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + delete-network-listener) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + delete-node-config) + _command_args=('*:nodes:_asadmin_nodes_config' '--host+:' '--port+:') + ;; + delete-node-dcom) + _command_args=('*:nodes:_asadmin_nodes_dcom' '--force+:force:(true false)' '--host+:' '--port+:' '--uninstall+:uninstall:(true false)') + ;; + delete-node-ssh) + _command_args=('*:nodes:_asadmin_nodes_ssh' '--force+:force:(true false)' '--host+:' '--port+:' '--uninstall+:uninstall:(true false)') + ;; + delete-password-alias) + _command_args=('--host+:' '--port+:') + ;; + delete-profiler) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + delete-protocol) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + delete-protocol-filter) + _command_args=('--host+:' '--port+:' '--protocol+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + delete-protocol-finder) + _command_args=('--host+:' '--port+:' '--protocol+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + delete-resource-adapter-config) + _command_args=('--host+:' '--port+:' '--target+:') + ;; + delete-resource-ref) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_das_standalone_instance') + ;; + delete-ssl) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance' '--type+:type:(network-listener http-listener iiop-listener iiop-service jmx-connector)') + ;; + delete-system-property) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_clustered_instance_config_das_domain_standalone_instance') + ;; + delete-threadpool) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + delete-transport) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + delete-virtual-server) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + deploy) + _command_args=('*:directory:_files' '--asyncreplication+:asyncreplication:(true false)' '--availabilityenabled+:availabilityenabled:(true false)' '--contextroot+:' '--createtables+:createtables:(true false)' '--dbvendorname+:' '--deploymentplan+:deploymentplan:directory:_files' '--description+:' '--dropandcreatetables+:dropandcreatetables:(true false)' '--enabled+:enabled:(true false)' '--force+:force:(true false)' '--generatermistubs+:generatermistubs:(true false)' '--host+:' '--isredeploy+:isredeploy:(true false)' '--keepfailedstubs+:keepfailedstubs:(true false)' '--keepreposdir+:keepreposdir:(true false)' '--keepstate+:keepstate:(true false)' '--lbenabled+:lbenabled:(true false)' '--libraries+:' '--logreportederrors+:logreportederrors:(true false)' '--name+:' '--port+:' '--precompilejsp+:precompilejsp:(true false)' '--properties+:' '--property+:' '--retrieve+:' '--target+:target:_asadmin_targets_cluster_das_domain_standalone_instance' '--type+:' '--uniquetablenames+:uniquetablenames:(true false)' '--verify+:verify:(true false)' '--virtualservers+:') + ;; + deploydir) + _command_args=('*:directory:_files' '--asyncreplication+:asyncreplication:(true false)' '--availabilityenabled+:availabilityenabled:(true false)' '--contextroot+:' '--createtables+:createtables:(true false)' '--dbvendorname+:' '--deploymentplan+:deploymentplan:directory:_files' '--description+:' '--dropandcreatetables+:dropandcreatetables:(true false)' '--enabled+:enabled:(true false)' '--force+:force:(true false)' '--generatermistubs+:generatermistubs:(true false)' '--host+:' '--isredeploy+:isredeploy:(true false)' '--keepfailedstubs+:keepfailedstubs:(true false)' '--keepreposdir+:keepreposdir:(true false)' '--keepstate+:keepstate:(true false)' '--lbenabled+:lbenabled:(true false)' '--libraries+:' '--logreportederrors+:logreportederrors:(true false)' '--name+:' '--port+:' '--precompilejsp+:precompilejsp:(true false)' '--properties+:' '--property+:' '--retrieve+:' '--target+:target:_asadmin_targets_cluster_das_domain_standalone_instance' '--type+:' '--uniquetablenames+:uniquetablenames:(true false)' '--verify+:verify:(true false)' '--virtualservers+:') + ;; + disable) + _command_args=('--cascade+:cascade:(true false)' '--droptables+:droptables:(true false)' '--host+:' '--isredeploy+:isredeploy:(true false)' '--isundeploy+:isundeploy:(true false)' '--keepreposdir+:keepreposdir:(true false)' '--keepstate+:keepstate:(true false)' '--port+:' '--properties+:' '--target+:target:_asadmin_targets_cluster_clustered_instance_das_domain_standalone_instance') + ;; + disable-http-lb-application) + _command_args=('--host+:' '--name+:' '--port+:' '--timeout+:') + ;; + disable-http-lb-server) + _command_args=('--host+:' '--port+:' '--timeout+:') + ;; + disable-monitoring) + _command_args=('--host+:' '--modules+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + disable-secure-admin) + _command_args=('--host+:' '--port+:') + ;; + enable) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_clustered_instance_das_domain_standalone_instance') + ;; + enable-http-lb-application) + _command_args=('--host+:' '--name+:' '--port+:') + ;; + enable-http-lb-server) + _command_args=('--host+:' '--port+:') + ;; + enable-monitoring) + _command_args=('--dtrace+:dtrace:(true false)' '--host+:' '--mbean+:mbean:(true false)' '--modules+:' '--options+:' '--pid+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + enable-secure-admin) + _command_args=('--adminalias+:' '--host+:' '--instancealias+:' '--port+:') + ;; + export-http-lb-config) + _command_args=('--config+:' '--host+:' '--lbname+:' '--lbtargets+:' '--port+:' '--property+:' '--retrievefile+:retrievefile:(true false)') + ;; + export-sync-bundle) + _command_args=('--host+:' '--port+:' '--retrieve+:retrieve:(true false)' '--target+:') + ;; + flush-connection-pool) + _command_args=('--appname+:' '--host+:' '--modulename+:' '--port+:') + ;; + flush-jmsdest) + _command_args=('--desttype+:' '--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + freeze-transaction-service) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_clustered_instance_config_das_standalone_instance') + ;; + generate-domain-schema) + _command_args=('--format+:' '--host+:' '--port+:' '--showdeprecated+:showdeprecated:(true false)' '--showsubclasses+:showsubclasses:(true false)') + ;; + generate-jvm-report) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_clustered_instance_das_standalone_instance' '--type+:type:(summary thread class memory log)') + ;; + get) + _command_args=('--host+:' '--monitor+:monitor:(true false)' '--port+:') + ;; + get-client-stubs) + _command_args=('--appname+:' '--host+:' '--port+:') + ;; + get-health) + _command_args=('--host+:' '--port+:') + ;; + help) + _describe -t help-commands "asadmin help command" _1st_arguments + ;; + import-sync-bundle) + _command_args=('--instance+:' '--node+:node:_asadmin_nodes' '--nodedir+:') + ;; + install-node) + _command_args=('--archive+:' '--create+:create:(true false)' '--force+:force:(true false)' '--installdir+:' '--save+:save:(true false)' '--sshkeyfile+:' '--sshport+:' '--sshuser+:') + ;; + install-node-dcom) + _command_args=('--archive+:' '--create+:create:(true false)' '--force+:force:(true false)' '--installdir+:' '--save+:save:(true false)' '--windowsdomain+:' '--windowsuser+:') + ;; + install-node-ssh) + _command_args=('--archive+:' '--create+:create:(true false)' '--force+:force:(true false)' '--installdir+:' '--save+:save:(true false)' '--sshkeyfile+:' '--sshport+:' '--sshuser+:') + ;; + jms-ping) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_clustered_instance_config_das_standalone_instance') + ;; + list) + _command_args=('--host+:' '--monitor+:monitor:(true false)' '--port+:') + ;; + list-admin-objects) + _command_args=('*:targets:_asadmin_targets_cluster_clustered_instance_config_das_standalone_instance' '--host+:' '--port+:') + ;; + list-application-refs) + _command_args=('*:targets:_asadmin_targets_cluster_das_standalone_instance' '--host+:' '--long+:long:(true false)' '--port+:' '--terse+:terse:(true false)') + ;; + list-applications) + _command_args=('*:targets:_asadmin_targets_cluster_das_domain_standalone_instance' '--host+:' '--long+:long:(true false)' '--port+:' '--resources+:resources:(true false)' '--subcomponents+:subcomponents:(true false)' '--terse+:terse:(true false)' '--type+:') + ;; + list-audit-modules) + _command_args=('*:targets:_asadmin_targets_cluster_clustered_instance_config_das_standalone_instance' '--host+:' '--port+:') + ;; + list-auth-realms) + _command_args=('*:targets:_asadmin_targets_cluster_clustered_instance_config_das_standalone_instance' '--host+:' '--port+:') + ;; + list-backups) + _command_args=('--backupconfig+:' '--backupdir+:' '--domaindir+:' '--long+:long:(true false)') + ;; + list-clusters) + _command_args=('--host+:' '--port+:') + ;; + list-commands) + _command_args=('--localonly+:localonly:(true false)' '--remoteonly+:remoteonly:(true false)') + ;; + list-components) + _command_args=('*:targets:_asadmin_targets_cluster_das_domain_standalone_instance' '--host+:' '--long+:long:(true false)' '--port+:' '--resources+:resources:(true false)' '--subcomponents+:subcomponents:(true false)' '--terse+:terse:(true false)' '--type+:') + ;; + list-configs) + _command_args=('*:targets:_asadmin_targets_cluster_clustered_instance_config_das_domain_standalone_instance' '--host+:' '--port+:') + ;; + list-connector-connection-pools) + _command_args=('--host+:' '--port+:') + ;; + list-connector-resources) + _command_args=('*:targets:_asadmin_targets_cluster_clustered_instance_das_domain_standalone_instance' '--host+:' '--port+:') + ;; + list-connector-security-maps) + _command_args=('--host+:' '--long+:long:(true false)' '--port+:' '--securitymap+:' '--target+:target:_asadmin_targets_cluster_clustered_instance_das_domain_standalone_instance') + ;; + list-connector-work-security-maps) + _command_args=('--host+:' '--port+:' '--securitymap+:') + ;; + list-containers) + _command_args=('--host+:' '--port+:') + ;; + list-custom-resources) + _command_args=('*:targets:_asadmin_targets_cluster_clustered_instance_das_domain_standalone_instance' '--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_clustered_instance_das_domain_standalone_instance') + ;; + list-descriptors) + _command_args=('--host+:' '--port+:') + ;; + list-domains) + _command_args=('--domaindir+:') + ;; + list-file-groups) + _command_args=('--authrealmname+:' '--host+:' '--name+:' '--port+:') + ;; + list-file-users) + _command_args=('*:targets:_asadmin_targets_cluster_clustered_instance_config_das_standalone_instance' '--authrealmname+:' '--host+:' '--port+:') + ;; + list-http-lb-configs) + _command_args=('--host+:' '--port+:') + ;; + list-http-listeners) + _command_args=('*:targets:_asadmin_targets_cluster_config_das_standalone_instance' '--host+:' '--long+:long:(true false)' '--port+:') + ;; + list-iiop-listeners) + _command_args=('*:targets:_asadmin_targets_cluster_clustered_instance_config_das_domain_standalone_instance' '--host+:' '--port+:') + ;; + list-instances) + _command_args=('--host+:' '--long+:long:(true false)' '--nostatus+:nostatus:(true false)' '--port+:' '--standaloneonly+:standaloneonly:(true false)' '--timeoutmsec+:') + ;; + list-jacc-providers) + _command_args=('*:targets:_asadmin_targets_cluster_clustered_instance_config_das_standalone_instance' '--host+:' '--port+:') + ;; + list-javamail-resources) + _command_args=('*:targets:_asadmin_targets_cluster_clustered_instance_das_domain_standalone_instance' '--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_clustered_instance_das_domain_standalone_instance') + ;; + list-jdbc-connection-pools) + _command_args=('--host+:' '--port+:') + ;; + list-jdbc-resources) + _command_args=('--host+:' '--port+:') + ;; + list-jms-hosts) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + list-jms-resources) + _command_args=('*:targets:_asadmin_targets_cluster_das_domain_standalone_instance' '--host+:' '--port+:' '--restype+:') + ;; + list-jmsdest) + _command_args=('*:targets:_asadmin_targets_cluster_config_das_standalone_instance' '--desttype+:' '--host+:' '--port+:' '--property+:') + ;; + list-jndi-entries) + _command_args=('*:targets:_asadmin_targets_cluster_clustered_instance_das_domain_standalone_instance' '--context+:' '--host+:' '--port+:') + ;; + list-jndi-resources) + _command_args=('*:targets:_asadmin_targets_cluster_clustered_instance_das_domain_standalone_instance' '--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_clustered_instance_das_domain_standalone_instance') + ;; + list-jvm-options) + _command_args=('--host+:' '--port+:' '--profiler+:profiler:(true false)' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + list-libraries) + _command_args=('--host+:' '--port+:' '--type+:type:(common ext app)') + ;; + list-lifecycle-modules) + _command_args=('*:targets:_asadmin_targets_cluster_das_domain_standalone_instance' '--host+:' '--port+:' '--terse+:terse:(true false)') + ;; + list-log-attributes) + _command_args=('*:targets:_asadmin_targets_cluster_clustered_instance_config_das_standalone_instance' '--host+:' '--port+:') + ;; + list-log-levels) + _command_args=('--host+:' '--port+:') + ;; + list-message-security-providers) + _command_args=('*:targets:_asadmin_targets_cluster_clustered_instance_config_das_standalone_instance' '--host+:' '--layer+:layer:(SOAP HttpServlet)' '--port+:') + ;; + list-modules) + _command_args=('--host+:' '--port+:') + ;; + list-network-listeners) + _command_args=('*:targets:_asadmin_targets_cluster_config_das_standalone_instance' '--host+:' '--port+:') + ;; + list-nodes) + _command_args=('--host+:' '--long+:long:(true false)' '--port+:' '--terse+:terse:(true false)') + ;; + list-nodes-config) + _command_args=('--host+:' '--long+:long:(true false)' '--port+:' '--terse+:terse:(true false)') + ;; + list-nodes-dcom) + _command_args=('--host+:' '--long+:long:(true false)' '--port+:' '--terse+:terse:(true false)') + ;; + list-nodes-ssh) + _command_args=('--host+:' '--long+:long:(true false)' '--port+:' '--terse+:terse:(true false)') + ;; + list-password-aliases) + _command_args=('--host+:' '--port+:') + ;; + list-persistence-types) + _command_args=('--host+:' '--port+:' '--type+:') + ;; + list-protocol-filters) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + list-protocol-finders) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + list-protocols) + _command_args=('*:targets:_asadmin_targets_cluster_config_das_standalone_instance' '--host+:' '--port+:') + ;; + list-resource-adapter-configs) + _command_args=('--host+:' '--long+:long:(true false)' '--port+:' '--raname+:') + ;; + list-resource-refs) + _command_args=('*:targets:_asadmin_targets_cluster_clustered_instance_das_standalone_instance' '--host+:' '--port+:') + ;; + list-sub-components) + _command_args=('--appname+:' '--host+:' '--port+:' '--resources+:resources:(true false)' '--terse+:terse:(true false)' '--type+:') + ;; + list-supported-cipher-suites) + _command_args=('--host+:' '--port+:') + ;; + list-system-properties) + _command_args=('*:targets:_asadmin_targets_cluster_clustered_instance_config_das_domain_standalone_instance' '--host+:' '--port+:') + ;; + list-threadpools) + _command_args=('--host+:' '--port+:') + ;; + list-timers) + _command_args=('*:targets:_asadmin_targets_cluster_das_standalone_instance' '--host+:' '--port+:') + ;; + list-transports) + _command_args=('*:targets:_asadmin_targets_cluster_config_das_standalone_instance' '--host+:' '--port+:') + ;; + list-virtual-servers) + _command_args=('*:targets:_asadmin_targets_cluster_config_das_standalone_instance' '--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + list-web-context-param) + _command_args=('--host+:' '--name+:' '--port+:') + ;; + list-web-env-entry) + _command_args=('--host+:' '--name+:' '--port+:') + ;; + login) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_das_standalone_instance') + ;; + migrate-timers) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_clustered_instance_das') + ;; + monitor) + _command_args=('--filename+:filename:directory:_files' '--filter+:' '--interval+:' '--type+:') + ;; + multimode) + _command_args=('--encoding+:' '--file+:file:directory:_files' '--printprompt+:printprompt:(true false)') + ;; + ping-connection-pool) + _command_args=('--appname+:' '--host+:' '--modulename+:' '--port+:' '--target+:') + ;; + ping-node-dcom) + _command_args=('*:nodes:_asadmin_nodes_dcom' '--host+:' '--port+:' '--validate+:validate:(true false)') + ;; + ping-node-ssh) + _command_args=('*:nodes:_asadmin_nodes_ssh' '--host+:' '--port+:' '--validate+:validate:(true false)') + ;; + recover-transactions) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_clustered_instance_das_standalone_instance' '--transactionlogdir+:') + ;; + redeploy) + _command_args=('*:directory:_files' '--asyncreplication+:asyncreplication:(true false)' '--availabilityenabled+:availabilityenabled:(true false)' '--contextroot+:' '--createtables+:createtables:(true false)' '--dbvendorname+:' '--deploymentplan+:deploymentplan:directory:_files' '--description+:' '--dropandcreatetables+:dropandcreatetables:(true false)' '--enabled+:enabled:(true false)' '--force+:force:(true false)' '--generatermistubs+:generatermistubs:(true false)' '--host+:' '--isredeploy+:isredeploy:(true false)' '--keepfailedstubs+:keepfailedstubs:(true false)' '--keepreposdir+:keepreposdir:(true false)' '--keepstate+:keepstate:(true false)' '--lbenabled+:lbenabled:(true false)' '--libraries+:' '--logreportederrors+:logreportederrors:(true false)' '--name+:' '--port+:' '--precompilejsp+:precompilejsp:(true false)' '--properties+:' '--property+:' '--retrieve+:' '--target+:target:_asadmin_targets_cluster_das_domain_standalone_instance' '--type+:' '--uniquetablenames+:uniquetablenames:(true false)' '--verify+:verify:(true false)' '--virtualservers+:') + ;; + remove-library) + _command_args=('*:libraries:_asadmin_libraries' '--host+:' '--port+:' '--type+:type:(common ext app)') + ;; + restart-domain) + _command_args=('--debug+:debug:(true false)' '--domaindir+:' '--force+:force:(true false)' '--kill+:kill:(true false)') + ;; + restart-instance) + _command_args=('*:instances:_asadmin_instances' '--debug+:' '--host+:' '--port+:') + ;; + restart-local-instance) + _command_args=('*:instances:_asadmin_instances' '--debug+:debug:(true false)' '--force+:force:(true false)' '--kill+:kill:(true false)' '--node+:node:_asadmin_nodes' '--nodedir+:') + ;; + restore-domain) + _command_args=('--backupconfig+:' '--backupdir+:' '--description+:' '--domaindir+:' '--filename+:' '--force+:force:(true false)' '--long+:long:(true false)') + ;; + rollback-transaction) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_clustered_instance_das_standalone_instance' '--transaction_id+:') + ;; + rotate-log) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_clustered_instance_das_standalone_instance') + ;; + set) + _command_args=('--host+:' '--port+:') + ;; + set-log-attributes) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + set-log-levels) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance') + ;; + set-web-context-param) + _command_args=('--description+:' '--host+:' '--ignoredescriptoritem+:ignoredescriptoritem:(true false)' '--name+:' '--port+:' '--value+:') + ;; + set-web-env-entry) + _command_args=('--description+:' '--host+:' '--ignoredescriptoritem+:ignoredescriptoritem:(true false)' '--name+:' '--port+:' '--type+:' '--value+:') + ;; + setup-ssh) + _command_args=('--generatekey+:generatekey:(true false)' '--sshkeyfile+:' '--sshport+:' '--sshpublickeyfile+:' '--sshuser+:') + ;; + show-component-status) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_clustered_instance_das_domain_standalone_instance') + ;; + start-cluster) + _command_args=('*:clusters:_asadmin_clusters' '--autohadboverride+:autohadboverride:(true false)' '--host+:' '--port+:' '--verbose+:verbose:(true false)') + ;; + start-database) + _command_args=('--dbhome+:' '--dbhost+:' '--dbport+:' '--jvmoptions+:') + ;; + start-domain) + _command_args=('--debug+:debug:(true false)' '--domaindir+:' '--upgrade+:upgrade:(true false)' '--verbose+:verbose:(true false)') + ;; + start-instance) + _command_args=('*:instances:_asadmin_instances' '--debug+:debug:(true false)' '--host+:' '--port+:' '--setenv+:' '--sync+:sync:(none normal full)' '--terse+:terse:(true false)') + ;; + start-local-instance) + _command_args=('*:instances:_asadmin_instances' '--debug+:debug:(true false)' '--node+:node:_asadmin_nodes' '--nodedir+:' '--sync+:sync:(none normal full)' '--verbose+:verbose:(true false)') + ;; + stop-cluster) + _command_args=('*:clusters:_asadmin_clusters' '--autohadboverride+:autohadboverride:(true false)' '--host+:' '--kill+:kill:(true false)' '--port+:' '--verbose+:verbose:(true false)') + ;; + stop-database) + _command_args=('--dbhost+:' '--dbport+:' '--dbuser+:') + ;; + stop-domain) + _command_args=('--domaindir+:' '--force+:force:(true false)' '--kill+:kill:(true false)') + ;; + stop-instance) + _command_args=('*:instances:_asadmin_instances' '--force+:force:(true false)' '--host+:' '--kill+:kill:(true false)' '--port+:') + ;; + stop-local-instance) + _command_args=('*:instances:_asadmin_instances' '--force+:force:(true false)' '--kill+:kill:(true false)' '--node+:node:_asadmin_nodes' '--nodedir+:') + ;; + test-upgrade) + _command_args=('--host+:' '--port+:') + ;; + undeploy) + _command_args=('*:applications:_asadmin_applications' '--cascade+:cascade:(true false)' '--droptables+:droptables:(true false)' '--host+:' '--isredeploy+:isredeploy:(true false)' '--keepreposdir+:keepreposdir:(true false)' '--keepstate+:keepstate:(true false)' '--port+:' '--properties+:' '--target+:target:_asadmin_targets_cluster_das_domain_standalone_instance') + ;; + unfreeze-transaction-service) + _command_args=('--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_clustered_instance_config_das_standalone_instance') + ;; + uninstall-node) + _command_args=('--force+:force:(true false)' '--installdir+:' '--sshkeyfile+:' '--sshport+:' '--sshuser+:') + ;; + uninstall-node-dcom) + _command_args=('--force+:force:(true false)' '--installdir+:' '--windowsdomain+:' '--windowsuser+:') + ;; + uninstall-node-ssh) + _command_args=('--force+:force:(true false)' '--installdir+:' '--sshkeyfile+:' '--sshport+:' '--sshuser+:') + ;; + unset-web-context-param) + _command_args=('--host+:' '--name+:' '--port+:') + ;; + unset-web-env-entry) + _command_args=('--host+:' '--name+:' '--port+:') + ;; + update-connector-security-map) + _command_args=('--addprincipals+:' '--addusergroups+:' '--host+:' '--mappedpassword+:' '--mappedusername+:' '--poolname+:' '--port+:' '--removeprincipals+:' '--removeusergroups+:' '--target+:') + ;; + update-connector-work-security-map) + _command_args=('--addgroups+:' '--addprincipals+:' '--host+:' '--port+:' '--raname+:' '--removegroups+:' '--removeprincipals+:') + ;; + update-file-user) + _command_args=('--authrealmname+:' '--groups+:' '--host+:' '--port+:' '--target+:target:_asadmin_targets_cluster_config_das_standalone_instance' '--userpassword+:') + ;; + update-node-config) + _command_args=('*:nodes:_asadmin_nodes_config' '--host+:' '--installdir+:' '--nodedir+:' '--nodehost+:' '--port+:') + ;; + update-node-dcom) + _command_args=('*:nodes:_asadmin_nodes_dcom' '--force+:force:(true false)' '--host+:' '--installdir+:' '--nodedir+:' '--nodehost+:' '--port+:' '--windowsdomain+:' '--windowspassword+:' '--windowsuser+:') + ;; + update-node-ssh) + _command_args=('*:nodes:_asadmin_nodes_ssh' '--force+:force:(true false)' '--host+:' '--installdir+:' '--nodedir+:' '--nodehost+:' '--port+:' '--sshkeyfile+:' '--sshkeypassphrase+:' '--sshpassword+:' '--sshport+:' '--sshuser+:') + ;; + update-password-alias) + _command_args=('--aliaspassword+:' '--host+:' '--port+:') + ;; + uptime) + _command_args=('--host+:' '--milliseconds+:milliseconds:(true false)' '--port+:') + ;; + validate-dcom) + _command_args=('--host+:' '--port+:' '--remotetestdir+:' '--verbose+:verbose:(true false)' '--windowsdomain+:' '--windowspassword+:' '--windowsuser+:') + ;; + validate-multicast) + _command_args=('--bindaddress+:' '--multicastaddress+:' '--multicastport+:' '--sendperiod+:' '--timeout+:' '--timetolive+:' '--verbose+:verbose:(true false)') + ;; + verify-domain-xml) + _command_args=('--domaindir+:') + ;; + version) + _command_args=('--local+:local:(true false)' '--terse+:terse:(true false)' '--verbose+:verbose:(true false)') + ;; +esac + + +_asadmin_applications() { + compadd $(command asadmin list-applications --terse | sed 's/\s.*//') +} + +_asadmin_clusters() { + compadd $(command asadmin list-clusters --terse | sed 's/\s.*//') +} + +_asadmin_configs() { + compadd $(command asadmin list-configs --terse) +} + +_asadmin_instances() { + compadd $(command asadmin list-instances --terse --nostatus domain) +} + +_asadmin_instances_standalone() { + compadd $(command asadmin list-instances --terse --standaloneonly --nostatus domain) +} + +_asadmin_libraries() { + compadd $(command asadmin list-libraries --terse) +} + +_asadmin_nodes() { + compadd $(command asadmin list-nodes --terse) +} + +_asadmin_nodes_config() { + compadd $(command asadmin list-nodes-config --terse) +} + +_asadmin_nodes_dcom() { + compadd $(command asadmin list-nodes-dcom --terse) +} + +_asadmin_nodes_ssh() { + compadd $(command asadmin list-nodes-ssh --terse) +} + +_asadmin_targets() { + _asadmin_instances + _asadmin_clusters + _asadmin_configs + compadd domain server +} + +_asadmin_targets_cluster_clustered_instance_config_das_domain_standalone_instance() { + _asadmin_instances + _asadmin_clusters + _asadmin_configs + compadd domain server +} + +_asadmin_targets_cluster_clustered_instance_config_das_standalone_instance() { + _asadmin_instances + _asadmin_clusters + _asadmin_configs + compadd server +} + +_asadmin_targets_cluster_clustered_instance_das_domain_standalone_instance() { + _asadmin_instances + _asadmin_clusters + compadd domain server +} + +_asadmin_targets_cluster_clustered_instance_das_standalone_instance() { + _asadmin_instances + _asadmin_clusters + _asadmin_configs + compadd server +} + +_asadmin_targets_cluster_config_das_standalone_instance() { + _asadmin_instances_standalone + _asadmin_clusters + _asadmin_configs + compadd server +} + +_asadmin_targets_cluster_das_domain_standalone_instance() { + _asadmin_instances_standalone + _asadmin_clusters + compadd domain server +} + +_asadmin_targets_cluster_das_standalone_instance() { + _asadmin_instances_standalone + _asadmin_clusters + compadd server +} + +_asadmin_targets_clustered_instance_das() { + _asadmin_instances + compadd server +} + +_asadmin_targets_clustered_instance_das_standalone_instance() { + _asadmin_instances + compadd server +} + +_asadmin_targets_cluster_standalone_instance() { + _asadmin_clusters + _asadmin_instances_standalone +} + + +compadd '--help' +_arguments \ + $_command_args \ + && return 0; diff --git a/plugins/glassfish/glassfish.plugin.zsh b/plugins/glassfish/glassfish.plugin.zsh new file mode 100644 index 000000000..fde2edb2a --- /dev/null +++ b/plugins/glassfish/glassfish.plugin.zsh @@ -0,0 +1,3 @@ +# if there is a user named 'glassfish' on the system, we'll assume +# that is the user asadmin should be run as +# grep -e '^glassfish' /etc/passwd > /dev/null && alias asadmin='sudo -u glassfish asadmin' \ No newline at end of file diff --git a/plugins/knife/_knife b/plugins/knife/_knife index b44283f78..163149267 100644 --- a/plugins/knife/_knife +++ b/plugins/knife/_knife @@ -31,7 +31,7 @@ _knife() { case $state in knifecmd) - compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" diff exec environment index node recipe role search ssh status upload windows $cloudproviders + compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" diff exec environment index node recipe role search ssh status upload vault windows $cloudproviders ;; knifesubcmd) case $words[2] in @@ -65,6 +65,9 @@ _knife() { upload) _arguments '*:file or directory:_files -g "*"' ;; + vault) + compadd -Q "$@" create decrypt delete edit remove "rotate all keys" "rotate keys" show update + ;; windows) compadd "$@" bootstrap ;; diff --git a/plugins/laravel4/laravel4.plugin.zsh b/plugins/laravel4/laravel4.plugin.zsh new file mode 100644 index 000000000..4b1022b66 --- /dev/null +++ b/plugins/laravel4/laravel4.plugin.zsh @@ -0,0 +1,20 @@ +# Laravel4 basic command completion +_laravel4_get_command_list () { + php artisan --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }' +} + +_laravel4 () { + if [ -f artisan ]; then + compadd `_laravel4_get_command_list` + fi +} + +compdef _laravel4 artisan +compdef _laravel4 la4 + +#Alias +alias la4='php artisan' + +alias la4dump='php artisan dump-autoload' +alias la4cache='php artisan cache:clear' +alias la4routes='php artisan routes' diff --git a/plugins/pip/_pip b/plugins/pip/_pip index 7c1238db7..9892dd19c 100644 --- a/plugins/pip/_pip +++ b/plugins/pip/_pip @@ -59,6 +59,7 @@ case "$words[1]" in _arguments \ '(-U --upgrade)'{-U,--upgrade}'[upgrade all packages to the newest available version]' \ '(-f --find-links)'{-f,--find-links}'[URL for finding packages]' \ + '(-r --requirement)'{-r,--requirement}'[Requirements file for packages to install]:File:_files' \ '(--no-deps --no-dependencies)'{--no-deps,--no-dependencies}'[iIgnore package dependencies]' \ '(--no-install)--no-install[only download packages]' \ '(--no-download)--no-download[only install downloaded packages]' \ diff --git a/plugins/pow/pow.plugin.zsh b/plugins/pow/pow.plugin.zsh index 399a54cb0..7f86c0c76 100644 --- a/plugins/pow/pow.plugin.zsh +++ b/plugins/pow/pow.plugin.zsh @@ -8,18 +8,18 @@ # Supports command completion. # # If you are not already using completion you might need to enable it with -# +# # autoload -U compinit compinit # # Changes: # -# Defaults to the current application, and will walk up the tree to find +# Defaults to the current application, and will walk up the tree to find # a config.ru file and restart the corresponding app # -# Will Detect if a app does not exist in pow and print a (slightly) helpful +# Will Detect if a app does not exist in pow and print a (slightly) helpful # error message -rack_root_detect(){ +rack_root(){ setopt chaselinks local orgdir=$(pwd) local basedir=$(pwd) @@ -32,6 +32,11 @@ rack_root_detect(){ builtin cd $orgdir 2>/dev/null [[ ${basedir} == "/" ]] && return 1 + echo $basedir +} + +rack_root_detect(){ + basedir=$(rack_root) echo `basename $basedir | sed -E "s/.(com|net|org)//"` } @@ -51,16 +56,30 @@ kapow(){ compctl -W ~/.pow -/ kapow powit(){ - local basedir=$(pwd) + local basedir=$(pwd) local vhost=$1 [ ! -n "$vhost" ] && vhost=$(rack_root_detect) if [ ! -h ~/.pow/$vhost ] - then - echo "pow: Symlinking your app with pow. ${vhost}" - [ ! -d ~/.pow/${vhost} ] && ln -s $basedir ~/.pow/$vhost + then + echo "pow: Symlinking your app with pow. ${vhost}" + [ ! -d ~/.pow/${vhost} ] && ln -s $basedir ~/.pow/$vhost return 1 fi } +powed(){ + local basedir=$(rack_root) + find ~/.pow/ -type l -lname "*$basedir*" -exec basename {}'.dev' \; +} + +# Restart pow process +# taken from http://www.matthewratzloff.com/blog/2011/12/23/restarting-pow-when-dns-stops-responding +repow(){ + lsof | grep 20560 | awk '{print $2}' | xargs kill -9 + launchctl unload ~/Library/LaunchAgents/cx.pow.powd.plist + launchctl load ~/Library/LaunchAgents/cx.pow.powd.plist + echo "restarted pow" +} + # View the standard out (puts) from any pow app -alias kaput="tail -f ~/Library/Logs/Pow/apps/*" +alias kaput="tail -f ~/Library/Logs/Pow/apps/*" \ No newline at end of file diff --git a/plugins/rake-fast/rake-fast.plugin.zsh b/plugins/rake-fast/rake-fast.plugin.zsh new file mode 100644 index 000000000..320855233 --- /dev/null +++ b/plugins/rake-fast/rake-fast.plugin.zsh @@ -0,0 +1,51 @@ +# rake-fast +# Fast rake autocompletion plugin for oh-my-zsh + +# This script caches the output for later usage and significantly speeds it up. +# It generates a .rake_tasks file in parallel to the Rakefile. + +# You'll want to add `.rake_tasks` to your global .git_ignore file: +# https://help.github.com/articles/ignoring-files#global-gitignore + +# You can force .rake_tasks to refresh with: +# $ rake_refresh + +# This is entirely based on Ullrich Schäfer's work +# (https://github.com/robb/.dotfiles/pull/10/), +# which is inspired by this Ruby on Rails trick from 2006: +# http://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh/ + +_rake_refresh () { + if [ -f .rake_tasks ]; then + rm .rake_tasks + fi + echo "Generating .rake_tasks..." > /dev/stderr + _rake_generate + cat .rake_tasks +} + +_rake_does_task_list_need_generating () { + if [ ! -f .rake_tasks ]; then return 0; + else + accurate=$(stat -f%m .rake_tasks) + changed=$(stat -f%m Rakefile) + return $(expr $accurate '>=' $changed) + fi +} + +_rake_generate () { + rake --silent --tasks | cut -d " " -f 2 > .rake_tasks +} + +_rake () { + if [ -f Rakefile ]; then + if _rake_does_task_list_need_generating; then + echo "\nGenerating .rake_tasks..." > /dev/stderr + _rake_generate + fi + compadd `cat .rake_tasks` + fi +} + +compdef _rake rake +alias rake_refresh='_rake_refresh' diff --git a/plugins/rbenv/rbenv.plugin.zsh b/plugins/rbenv/rbenv.plugin.zsh index 57ae2ca1f..b6795b91c 100644 --- a/plugins/rbenv/rbenv.plugin.zsh +++ b/plugins/rbenv/rbenv.plugin.zsh @@ -10,9 +10,6 @@ FOUND_RBENV=0 rbenvdirs=("$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv") if _homebrew-installed && _rbenv-from-homebrew-installed ; then rbenvdirs=($(brew --prefix rbenv) "${rbenvdirs[@]}") - if [[ $RBENV_ROOT = '' ]]; then - RBENV_ROOT="$HOME/.rbenv" - fi fi for rbenvdir in "${rbenvdirs[@]}" ; do diff --git a/plugins/scd/README.md b/plugins/scd/README.md new file mode 100644 index 000000000..197cea50a --- /dev/null +++ b/plugins/scd/README.md @@ -0,0 +1,122 @@ +# scd - smart change of directory + +Define `scd` shell function for changing to any directory with +a few keystrokes. + +`scd` keeps history of the visited directories, which serves as an index of +the known paths. The directory index is updated after every `cd` command in +the shell and can be also filled manually by running `scd -a`. To switch to +some directory, `scd` needs few fragments of the desired path to match with +the index. A selection menu is displayed in case of several matches, with a +preference given to recently visited paths. `scd` can create permanent +directory aliases, which appear as named directories in zsh session. + +## INSTALLATION + +For oh-my-zsh, add `scd` to the `plugins` array in the ~/.zshrc file as in the +[template file](../../templates/zshrc.zsh-template#L45). + +Besides zsh, `scd` can be used with *bash*, *dash* or *tcsh* +shells and is also available as [Vim](http://www.vim.org/) plugin and +[IPython](http://ipython.org/) extension. For installation details, see +https://github.com/pavoljuhas/smart-change-directory. + +## SYNOPSIS + +```sh +scd [options] [pattern1 pattern2 ...] +``` + +## OPTIONS + +
+-a, --add
+ add specified directories to the directory index.
+ +--unindex
+ remove specified directories from the index.
+ +-r, --recursive
+ apply options --add or --unindex recursively.
+ +--alias=ALIAS
+ create alias for the current or specified directory and save it to + ~/.scdalias.zsh.
+ +--unalias
+ remove ALIAS definition for the current or specified directory from + ~/.scdalias.zsh.
+ +--list
+ show matching directories and exit.
+ +-v, --verbose
+ display directory rank in the selection menu.
+ +-h, --help
+ display this options summary and exit.
+
+ +## Examples + +```sh +# Index recursively some paths for the very first run +scd -ar ~/Documents/ + +# Change to a directory path matching "doc" +scd doc + +# Change to a path matching all of "a", "b" and "c" +scd a b c + +# Change to a directory path that ends with "ts" +scd "ts(#e)" + +# Show selection menu and ranking of 20 most likely directories +scd -v + +# Alias current directory as "xray" +scd --alias=xray + +# Jump to a previously defined aliased directory +scd xray +``` + +# FILES + +
+~/.scdhistory
+ time-stamped index of visited directories.
+ +~/.scdalias.zsh
+ scd-generated definitions of directory aliases.
+
+ +# ENVIRONMENT + +
+SCD_HISTFILE
+ path to the scd index file (by default ~/.scdhistory).
+ +SCD_HISTSIZE
+ maximum number of entries in the index (5000). Index is trimmed when it + exceeds SCD_HISTSIZE by more than 20%.
+ +SCD_MENUSIZE
+ maximum number of items for directory selection menu (20).
+ +SCD_MEANLIFE
+ mean lifetime in seconds for exponential decay of directory + likelihood (86400).
+ +SCD_THRESHOLD
+ threshold for cumulative directory likelihood. Directories with + a lower likelihood compared to the best match are excluded (0.005). +
+ +SCD_SCRIPT
+ command script file where scd writes the final cd + command. This variable must be defined when scd runs in its own + process rather than as a shell function. It is up to the + scd caller to use the output in SCD_SCRIPT.
+
diff --git a/plugins/scd/scd b/plugins/scd/scd new file mode 100755 index 000000000..1567d2736 --- /dev/null +++ b/plugins/scd/scd @@ -0,0 +1,353 @@ +#!/bin/zsh -f + +emulate -L zsh +local EXIT=return +if [[ $(whence -w $0) == *:' 'command ]]; then + emulate -R zsh + local RUNNING_AS_COMMAND=1 + EXIT=exit +fi + +local DOC='scd -- smart change to a recently used directory +usage: scd [options] [pattern1 pattern2 ...] +Go to a directory path that contains all fixed string patterns. Prefer +recently visited directories and directories with patterns in their tail +component. Display a selection menu in case of multiple matches. + +Options: + -a, --add add specified directories to the directory index + --unindex remove specified directories from the index + -r, --recursive apply options --add or --unindex recursively + --alias=ALIAS create alias for the current or specified directory and + store it in ~/.scdalias.zsh + --unalias remove ALIAS definition for the current or specified + directory from ~/.scdalias.zsh + --list show matching directories and exit + -v, --verbose display directory rank in the selection menu + -h, --help display this message and exit +' + +local SCD_HISTFILE=${SCD_HISTFILE:-${HOME}/.scdhistory} +local SCD_HISTSIZE=${SCD_HISTSIZE:-5000} +local SCD_MENUSIZE=${SCD_MENUSIZE:-20} +local SCD_MEANLIFE=${SCD_MEANLIFE:-86400} +local SCD_THRESHOLD=${SCD_THRESHOLD:-0.005} +local SCD_SCRIPT=${RUNNING_AS_COMMAND:+$SCD_SCRIPT} +local SCD_ALIAS=~/.scdalias.zsh + +local ICASE a d m p i tdir maxrank threshold +local opt_help opt_add opt_unindex opt_recursive opt_verbose +local opt_alias opt_unalias opt_list +local -A drank dalias +local dmatching +local last_directory + +setopt extendedhistory extendedglob noautonamedirs brace_ccl + +# If SCD_SCRIPT is defined make sure the file exists and is empty. +# This removes any previous old commands. +[[ -n "$SCD_SCRIPT" ]] && [[ -s $SCD_SCRIPT || ! -f $SCD_SCRIPT ]] && ( + umask 077 + : >| $SCD_SCRIPT +) + +# process command line options +zmodload -i zsh/zutil +zmodload -i zsh/datetime +zparseopts -D -- a=opt_add -add=opt_add -unindex=opt_unindex \ + r=opt_recursive -recursive=opt_recursive \ + -alias:=opt_alias -unalias=opt_unalias -list=opt_list \ + v=opt_verbose -verbose=opt_verbose h=opt_help -help=opt_help \ + || $EXIT $? + +if [[ -n $opt_help ]]; then + print $DOC + $EXIT +fi + +# load directory aliases if they exist +[[ -r $SCD_ALIAS ]] && source $SCD_ALIAS + +# works faster than the (:a) modifier and is compatible with zsh 4.2.6 +_scd_Y19oug_abspath() { + set -A $1 ${(ps:\0:)"$( + unfunction -m "*"; shift + for d; do + cd $d && print -Nr -- $PWD && cd $OLDPWD + done + )"} +} + +# define directory alias +if [[ -n $opt_alias ]]; then + if [[ -n $1 && ! -d $1 ]]; then + print -u2 "'$1' is not a directory." + $EXIT 1 + fi + a=${opt_alias[-1]#=} + _scd_Y19oug_abspath d ${1:-$PWD} + # alias in the current shell, update alias file if successful + hash -d -- $a=$d && + ( + umask 077 + hash -dr + [[ -r $SCD_ALIAS ]] && source $SCD_ALIAS + hash -d -- $a=$d + hash -dL >| $SCD_ALIAS + ) + $EXIT $? +fi + +# undefine directory alias +if [[ -n $opt_unalias ]]; then + if [[ -n $1 && ! -d $1 ]]; then + print -u2 "'$1' is not a directory." + $EXIT 1 + fi + _scd_Y19oug_abspath a ${1:-$PWD} + a=$(print -rD ${a}) + if [[ $a != [~][^/]## ]]; then + $EXIT + fi + a=${a#[~]} + # unalias in the current shell, update alias file if successful + if unhash -d -- $a 2>/dev/null && [[ -r $SCD_ALIAS ]]; then + ( + umask 077 + hash -dr + source $SCD_ALIAS + unhash -d -- $a 2>/dev/null && + hash -dL >| $SCD_ALIAS + ) + fi + $EXIT $? +fi + +# Rewrite directory index if it is at least 20% oversized +if [[ -s $SCD_HISTFILE ]] && \ +(( $(wc -l <$SCD_HISTFILE) > 1.2 * $SCD_HISTSIZE )); then + m=( ${(f)"$(<$SCD_HISTFILE)"} ) + print -lr -- ${m[-$SCD_HISTSIZE,-1]} >| ${SCD_HISTFILE} +fi + +# Determine the last recorded directory +if [[ -s ${SCD_HISTFILE} ]]; then + last_directory=${"$(tail -1 ${SCD_HISTFILE})"#*;} +fi + +# Internal functions are prefixed with "_scd_Y19oug_". +# The "record" function adds its arguments to the directory index. +_scd_Y19oug_record() { + while [[ -n $last_directory && $1 == $last_directory ]]; do + shift + done + if [[ $# -gt 0 ]]; then + ( umask 077 + p=": ${EPOCHSECONDS}:0;" + print -lr -- ${p}${^*} >>| $SCD_HISTFILE ) + fi +} + +if [[ -n $opt_add ]]; then + for d; do + if [[ ! -d $d ]]; then + print -u2 "Directory '$d' does not exist." + $EXIT 2 + fi + done + _scd_Y19oug_abspath m ${*:-$PWD} + _scd_Y19oug_record $m + if [[ -n $opt_recursive ]]; then + for d in $m; do + print -n "scanning ${d} ... " + _scd_Y19oug_record ${d}/**/*(-/N) + print "[done]" + done + fi + $EXIT +fi + +# take care of removing entries from the directory index +if [[ -n $opt_unindex ]]; then + if [[ ! -s $SCD_HISTFILE ]]; then + $EXIT + fi + # expand existing directories in the argument list + for i in {1..$#}; do + if [[ -d ${argv[i]} ]]; then + _scd_Y19oug_abspath d ${argv[i]} + argv[i]=${d} + fi + done + m="$(awk -v recursive=${opt_recursive} ' + BEGIN { + for (i = 2; i < ARGC; ++i) { + argset[ARGV[i]] = 1; + delete ARGV[i]; + } + } + 1 { + d = $0; sub(/^[^;]*;/, "", d); + if (d in argset) next; + } + recursive { + for (a in argset) { + if (substr(d, 1, length(a) + 1) == a"/") next; + } + } + { print $0 } + ' $SCD_HISTFILE ${*:-$PWD} )" || $EXIT $? + : >| ${SCD_HISTFILE} + [[ ${#m} == 0 ]] || print -r -- $m >> ${SCD_HISTFILE} + $EXIT +fi + +# The "action" function is called when there is just one target directory. +_scd_Y19oug_action() { + cd $1 || return $? + if [[ -z $SCD_SCRIPT && -n $RUNNING_AS_COMMAND ]]; then + print -u2 "Warning: running as command with SCD_SCRIPT undefined." + fi + if [[ -n $SCD_SCRIPT ]]; then + print -r "cd ${(q)1}" >| $SCD_SCRIPT + fi +} + +# Match and rank patterns to the index file +# set global arrays dmatching and drank +_scd_Y19oug_match() { + ## single argument that is an existing directory or directory alias + if [[ $# == 1 ]] && \ + [[ -d ${d::=$1} || -d ${d::=${nameddirs[$1]}} ]] && [[ -x $d ]]; + then + _scd_Y19oug_abspath dmatching $d + drank[${dmatching[1]}]=1 + return + fi + + # ignore case unless there is an argument with an uppercase letter + [[ "$*" == *[[:upper:]]* ]] || ICASE='(#i)' + + # calculate rank of all directories in the SCD_HISTFILE and keep it as drank + # include a dummy entry for splitting of an empty string is buggy + [[ -s $SCD_HISTFILE ]] && drank=( ${(f)"$( + print -l /dev/null -10 + <$SCD_HISTFILE \ + awk -v epochseconds=$EPOCHSECONDS -v meanlife=$SCD_MEANLIFE ' + BEGIN { FS = "[:;]"; } + length($0) < 4096 && $2 > 0 { + tau = 1.0 * ($2 - epochseconds) / meanlife; + if (tau < -4.61) tau = -4.61; + prec = exp(tau); + sub(/^[^;]*;/, ""); + if (NF) ptot[$0] += prec; + } + END { for (di in ptot) { print di; print ptot[di]; } }' + )"} + ) + unset "drank[/dev/null]" + + # filter drank to the entries that match all arguments + for a; do + p=${ICASE}"*${a}*" + drank=( ${(kv)drank[(I)${~p}]} ) + done + + # build a list of matching directories reverse-sorted by their probabilities + dmatching=( ${(f)"$( + for d p in ${(kv)drank}; do + print -r -- "$p $d"; + done | sort -grk1 | cut -d ' ' -f 2- + )"} + ) + + # if some directory paths match all patterns in order, discard all others + p=${ICASE}"*${(j:*:)argv}*" + m=( ${(M)dmatching:#${~p}} ) + [[ -d ${m[1]} ]] && dmatching=( $m ) + # if some directory names match last pattern, discard all others + p=${ICASE}"*${(j:*:)argv}[^/]#" + m=( ${(M)dmatching:#${~p}} ) + [[ -d ${m[1]} ]] && dmatching=( $m ) + # if some directory names match all patterns, discard all others + m=( $dmatching ) + for a; do + p=${ICASE}"*/[^/]#${a}[^/]#" + m=( ${(M)m:#${~p}} ) + done + [[ -d ${m[1]} ]] && dmatching=( $m ) + # if some directory names match all patterns in order, discard all others + p=${ICASE}"/*${(j:[^/]#:)argv}[^/]#" + m=( ${(M)dmatching:#${~p}} ) + [[ -d ${m[1]} ]] && dmatching=( $m ) + + # do not match $HOME or $PWD when run without arguments + if [[ $# == 0 ]]; then + dmatching=( ${dmatching:#(${HOME}|${PWD})} ) + fi + + # keep at most SCD_MENUSIZE of matching and valid directories + m=( ) + for d in $dmatching; do + [[ ${#m} == $SCD_MENUSIZE ]] && break + [[ -d $d && -x $d ]] && m+=$d + done + dmatching=( $m ) + + # find the maximum rank + maxrank=0.0 + for d in $dmatching; do + [[ ${drank[$d]} -lt maxrank ]] || maxrank=${drank[$d]} + done + + # discard all directories below the rank threshold + threshold=$(( maxrank * SCD_THRESHOLD )) + dmatching=( ${^dmatching}(Ne:'(( ${drank[$REPLY]} >= threshold ))':) ) +} + +_scd_Y19oug_match $* + +## process whatever directories that remained +if [[ ${#dmatching} == 0 ]]; then + print -u2 "No matching directory." + $EXIT 1 +fi + +## build formatted directory aliases for selection menu or list display +for d in $dmatching; do + if [[ -n ${opt_verbose} ]]; then + dalias[$d]=$(printf "%.3g %s" ${drank[$d]} $d) + else + dalias[$d]=$(print -Dr -- $d) + fi +done + +## process the --list option +if [[ -n $opt_list ]]; then + for d in $dmatching; do + print -r -- "# ${dalias[$d]}" + print -r -- $d + done + $EXIT +fi + +## process single directory match +if [[ ${#dmatching} == 1 ]]; then + _scd_Y19oug_action $dmatching + $EXIT $? +fi + +## here we have multiple matches - display selection menu +a=( {a-z} {A-Z} ) +p=( ) +for i in {1..${#dmatching}}; do + [[ -n ${a[i]} ]] || break + p+="${a[i]}) ${dalias[${dmatching[i]}]}" +done + +print -c -r -- $p + +if read -s -k 1 d && [[ ${i::=${a[(I)$d]}} -gt 0 ]]; then + _scd_Y19oug_action ${dmatching[i]} + $EXIT $? +fi diff --git a/plugins/scd/scd.plugin.zsh b/plugins/scd/scd.plugin.zsh new file mode 100644 index 000000000..0197c53a1 --- /dev/null +++ b/plugins/scd/scd.plugin.zsh @@ -0,0 +1,19 @@ +## The scd script should autoload as a shell function. +autoload scd + + +## If the scd function exists, define a change-directory-hook function +## to record visited directories in the scd index. +if [[ ${+functions[scd]} == 1 ]]; then + scd_chpwd_hook() { scd --add $PWD } + autoload add-zsh-hook + add-zsh-hook chpwd scd_chpwd_hook +fi + + +## Allow scd usage with unquoted wildcard characters such as "*" or "?". +alias scd='noglob scd' + + +## Load the directory aliases created by scd if any. +if [[ -s ~/.scdalias.zsh ]]; then source ~/.scdalias.zsh; fi diff --git a/plugins/vagrant/_vagrant b/plugins/vagrant/_vagrant index 9af8cb036..d55ae6709 100644 --- a/plugins/vagrant/_vagrant +++ b/plugins/vagrant/_vagrant @@ -44,7 +44,7 @@ __task_list () __box_list () { - _wanted application expl 'command' compadd $(command ls -1 $HOME/.vagrant/boxes 2>/dev/null| sed -e 's/ /\\ /g') + _wanted application expl 'command' compadd $(command vagrant box list | sed -e 's/ /\\ /g') } __vm_list () diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh index a06100472..3ed32b3fb 100644 --- a/plugins/vi-mode/vi-mode.plugin.zsh +++ b/plugins/vi-mode/vi-mode.plugin.zsh @@ -17,9 +17,15 @@ function zle-keymap-select zle-line-init zle-line-finish { zle -N zle-line-init zle -N zle-line-finish zle -N zle-keymap-select +zle -N edit-command-line + bindkey -v +# allow v to edit the command line (standard behaviour) +autoload -Uz edit-command-line +bindkey -M vicmd 'v' edit-command-line + # if mode indicator wasn't setup by theme, define default if [[ "$MODE_INDICATOR" == "" ]]; then MODE_INDICATOR="%{$fg_bold[red]%}<%{$fg[red]%}<<%{$reset_color%}" diff --git a/plugins/vim-interaction/README.md b/plugins/vim-interaction/README.md new file mode 100644 index 000000000..681648018 --- /dev/null +++ b/plugins/vim-interaction/README.md @@ -0,0 +1,82 @@ +# Vim Interaction # + +The plugin presents a function called `callvim` whose usage is: + + usage: callvim [-b cmd] [-a cmd] [file ... fileN] + + -b cmd Run this command in GVIM before editing the first file + -a cmd Run this command in GVIM after editing the first file + file The file to edit + ... fileN The other files to add to the argslist + +## Rationale ## + +The idea for this script is to give you some decent interaction with a running +GVim session. Normally you'll be running around your filesystem doing any +number of amazing things and you'll need to load some files into GVim for +editing, inspecting, destruction, or other bits of mayhem. This script lets you +do that. + +## Aliases ## + +There are a few aliases presented as well: + +* `v` A shorthand for `callvim` +* `vvsp` Edits the passed in file but first makes a vertical split +* `vhsp` Edits the passed in file but first makes a horizontal split + +## Post Callout ## + +At the end of the `callvim` function we invoke the `postCallVim` function if it +exists. If you're using MacVim, for example, you could define a function that +brings window focus to it after the file is loaded: + + function postCallVim + { + osascript -e 'tell application "MacVim" to activate' + } + +This'll be different depending on your OS / Window Manager. + +## Examples ## + +This will load `/tmp/myfile.scala` into the running GVim session: + + > v /tmp/myfile.scala + +This will load it after first doing a vertical split: + + > vvsp /tmp/myfile.scala + or + > v -b':vsp' /tmp/myfile.scala + +This will load it after doing a horizontal split, then moving to the bottom of +the file: + + > vhsp -aG /tmp/myfile.scala + or + > v -b':sp' -aG /tmp/myfile.scala + +This will load the file and then copy the first line to the end (Why you would +ever want to do this... I dunno): + + > v -a':1t$' /tmp/myfile.scala + +And this will load all of the `*.txt` files into the args list: + + > v *.txt + +If you want to load files into areas that are already split, use one of the +aliases for that: + + # Do a ':wincmd h' first + > vh /tmp/myfile.scala + + # Do a ':wincmd j' first + > vj /tmp/myfile.scala + + # Do a ':wincmd k' first + > vk /tmp/myfile.scala + + # Do a ':wincmd l' first + > vl /tmp/myfile.scala diff --git a/plugins/vim-interaction/vim-interaction.plugin.zsh b/plugins/vim-interaction/vim-interaction.plugin.zsh new file mode 100644 index 000000000..5142f1f9b --- /dev/null +++ b/plugins/vim-interaction/vim-interaction.plugin.zsh @@ -0,0 +1,72 @@ +# +# See README.md +# +# Derek Wyatt (derek@{myfirstnamemylastname}.org +# + +function resolveFile +{ + if [ -f "$1" ]; then + echo $(readlink -f "$1") + elif [[ "${1#/}" == "$1" ]]; then + echo "$(pwd)/$1" + else + echo $1 + fi +} + +function callvim +{ + if [[ $# == 0 ]]; then + cat <} == $after ]]; then + after="$after" + fi + if [[ ${before#:} != $before && ${before%} == $before ]]; then + before="$before" + fi + local files="" + for f in $@ + do + files="$files $(resolveFile $f)" + done + if [[ -n $files ]]; then + files=':args! '"$files" + fi + cmd="$before$files$after" + gvim --remote-send "$cmd" + if typeset -f postCallVim > /dev/null; then + postCallVim + fi +} + +alias v=callvim +alias vvsp="callvim -b':vsp'" +alias vhsp="callvim -b':sp'" +alias vk="callvim -b':wincmd k'" +alias vj="callvim -b':wincmd j'" +alias vl="callvim -b':wincmd l'" +alias vh="callvim -b':wincmd h'" diff --git a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh index 16f32da6e..f58bda1ad 100644 --- a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh +++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh @@ -1,4 +1,4 @@ -virtualenvwrapper='virtualenvwrapper_lazy.sh' +virtualenvwrapper='virtualenvwrapper.sh' if (( $+commands[$virtualenvwrapper] )); then source ${${virtualenvwrapper}:c} @@ -17,7 +17,7 @@ if (( $+commands[$virtualenvwrapper] )); then # Check for virtualenv name override if [[ -f "$PROJECT_ROOT/.venv" ]]; then ENV_NAME=`cat "$PROJECT_ROOT/.venv"` - elif [[ -f "$PROJECT_ROOT/.venv/bin/activate" ]];then + elif [[ -f "$PROJECT_ROOT/.venv/bin/activate" ]];then ENV_NAME="$PROJECT_ROOT/.venv" elif [[ "$PROJECT_ROOT" != "." ]]; then ENV_NAME=`basename "$PROJECT_ROOT"` diff --git a/plugins/zsh_reload/zsh_reload.plugin.zsh b/plugins/zsh_reload/zsh_reload.plugin.zsh new file mode 100644 index 000000000..a435dbc8d --- /dev/null +++ b/plugins/zsh_reload/zsh_reload.plugin.zsh @@ -0,0 +1,13 @@ +zsh_cache=$HOME/.zsh_cache +mkdir -p $zsh_cache + +# reload zshrc +function src() +{ + autoload -U compinit zrecompile + compinit -d $zsh_cache/zcomp-$HOST + for f in $HOME/.zshrc $zsh_cache/zcomp-$HOST; do + zrecompile -p $f && rm -f $f.zwc.old + done + source ~/.zshrc +} \ No newline at end of file diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index c2254d055..c25c20e75 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -1,5 +1,5 @@ # Path to your oh-my-zsh configuration. -ZSH=$HOME/.oh-my-zsh +export ZSH=$HOME/.oh-my-zsh # Set name of the theme to load. # Look in ~/.oh-my-zsh/themes/ diff --git a/themes/gallois.zsh-theme b/themes/gallois.zsh-theme index 1ff86b54c..f1057a9a9 100644 --- a/themes/gallois.zsh-theme +++ b/themes/gallois.zsh-theme @@ -18,7 +18,7 @@ else if which rbenv &> /dev/null; then RPS1='$(git_custom_status)%{$fg[red]%}[`rbenv version | sed -e "s/ (set.*$//"`]%{$reset_color%} $EPS1' else - if which chruby_prompt_info &> /dev/null; then + if [[ -n `which chruby_prompt_info` && -n `chruby_prompt_info` ]]; then RPS1='$(git_custom_status)%{$fg[red]%}[`chruby_prompt_info`]%{$reset_color%} $EPS1' else RPS1='$(git_custom_status) $EPS1' diff --git a/themes/gnzh.zsh-theme b/themes/gnzh.zsh-theme index 3c6b8a409..33f187bc6 100644 --- a/themes/gnzh.zsh-theme +++ b/themes/gnzh.zsh-theme @@ -6,7 +6,7 @@ autoload -U colors zsh/terminfo # Used in the colour alias below colors setopt prompt_subst -# make some aliases for the colours: (coud use normal escap.seq's too) +# make some aliases for the colours: (could use normal escape sequences too) for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do eval PR_$color='%{$fg[${(L)color}]%}' done @@ -25,7 +25,7 @@ elif [[ $UID -eq 0 ]]; then # root fi # Check if we are on SSH or not -if [[ -n "$SSH_CLIENT" || -n "$SSH2_CLIENT" ]]; then +if [[ -n "$SSH_CLIENT" || -n "$SSH2_CLIENT" ]]; then eval PR_HOST='${PR_YELLOW}%M${PR_NO_COLOR}' #SSH else eval PR_HOST='${PR_GREEN}%M${PR_NO_COLOR}' # no SSH @@ -36,12 +36,12 @@ local return_code="%(?..%{$PR_RED%}%? ↵%{$PR_NO_COLOR%})" local user_host='${PR_USER}${PR_CYAN}@${PR_HOST}' local current_dir='%{$PR_BOLD$PR_BLUE%}%~%{$PR_NO_COLOR%}' local rvm_ruby='' -if which rvm-prompt &> /dev/null; then +if ${HOME}/.rvm/bin/rvm-prompt &> /dev/null; then # detect local user rvm installation + rvm_ruby='%{$PR_RED%}‹$(${HOME}/.rvm/bin/rvm-prompt i v g s)›%{$PR_NO_COLOR%}' +elif which rvm-prompt &> /dev/null; then # detect sysem-wide rvm installation rvm_ruby='%{$PR_RED%}‹$(rvm-prompt i v g s)›%{$PR_NO_COLOR%}' -else - if which rbenv &> /dev/null; then - rvm_ruby='%{$PR_RED%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$PR_NO_COLOR%}' - fi +elif which rbenv &> /dev/null; then # detect Simple Ruby Version management + rvm_ruby='%{$PR_RED%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$PR_NO_COLOR%}' fi local git_branch='$(git_prompt_info)%{$PR_NO_COLOR%}'