Unverified Commit cad48e38 authored by Marc Cornellà's avatar Marc Cornellà Committed by GitHub
Browse files

Merge branch 'master' into fabric_task_description

parents 225425fe 40df67bc
...@@ -52,7 +52,7 @@ if [[ -x "${commands[gwhoami]}" ]]; then ...@@ -52,7 +52,7 @@ if [[ -x "${commands[gwhoami]}" ]]; then
# #
# This method is inflexible since the aliases are at risk of being # This method is inflexible since the aliases are at risk of being
# overriden resulting in the BSD coreutils being called. # overridden resulting in the BSD coreutils being called.
# #
# (( ${+commands[$gcmd]} )) && \ # (( ${+commands[$gcmd]} )) && \
# alias "$gcmd[2,-1]"="${prefix}/${gcmd//"["/"\\["}" # alias "$gcmd[2,-1]"="${prefix}/${gcmd//"["/"\\["}"
......
The go plugin is deprecated. Use the [golang plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/golang) instead.
# Golang plugin
This plugin adds completion for the [Go Programming Language](https://golang.org/),
as well as some aliases for common Golang commands.
To use it, add `golang` to the plugins array in your zshrc file:
```zsh
plugins=(... golang)
```
## Aliases
| Alias | Command | Description |
| ------- | ----------------------- | ------------------------------------------------------------- |
| gob | `go build` | Build your code |
| goc | `go clean` | Removes object files from package source directories |
| god | `go doc` | Prints documentation comments |
| gof | `go fmt` | Gofmt formats (aligns and indents) Go programs. |
| gofa | `go fmt ./...` | Run go fmt for all packages in current directory, recursively |
| gog | `go get` | Downloads packages and then installs them to $GOPATH |
| goi | `go install` | Compiles and installs packages to $GOPATH |
| gol | `go list` | Lists Go packages |
| gom | `go mod` | Access to operations on modules |
| gop | `cd $GOPATH` | Takes you to $GOPATH |
| gopb | `cd $GOPATH/bin` | Takes you to $GOPATH/bin |
| gops | `cd $GOPATH/src` | Takes you to $GOPATH/src |
| gor | `go run` | Compiles and runs your code |
| got | `go test` | Runs tests |
| gov | `go vet` | Vet examines Go source code and reports suspicious constructs |
...@@ -28,6 +28,7 @@ __go_tool_complete() { ...@@ -28,6 +28,7 @@ __go_tool_complete() {
'help[display help]' 'help[display help]'
'install[compile and install packages and dependencies]' 'install[compile and install packages and dependencies]'
'list[list packages]' 'list[list packages]'
'mod[modules maintenance]'
'run[compile and run Go program]' 'run[compile and run Go program]'
'test[test packages]' 'test[test packages]'
'tool[run specified go tool]' 'tool[run specified go tool]'
...@@ -83,7 +84,7 @@ __go_tool_complete() { ...@@ -83,7 +84,7 @@ __go_tool_complete() {
"-x[print remove commands as it executes them]" \ "-x[print remove commands as it executes them]" \
"*:importpaths:__go_packages" "*:importpaths:__go_packages"
;; ;;
fix|fmt|list|vet) fix|fmt|vet)
_alternative ':importpaths:__go_packages' ':files:_path_files -g "*.go"' _alternative ':importpaths:__go_packages' ':files:_path_files -g "*.go"'
;; ;;
install) install)
...@@ -124,8 +125,84 @@ __go_tool_complete() { ...@@ -124,8 +125,84 @@ __go_tool_complete() {
"-memprofilerate[set heap profiling rate]:number" \ "-memprofilerate[set heap profiling rate]:number" \
"*:args:{ _alternative ':importpaths:__go_packages' ':files:_path_files -g \"*.go\"' }" "*:args:{ _alternative ':importpaths:__go_packages' ':files:_path_files -g \"*.go\"' }"
;; ;;
list)
_arguments -s -w : \
"-f[alternative format for the list]:format" \
"-json[print data in json format]" \
"-compiled[set CompiledGoFiles to the Go source files presented to the compiler]" \
"-deps[iterate over not just the named packages but also all their dependencies]" \
"-e[change the handling of erroneous packages]" \
"-export[set the Export field to the name of a file containing up-to-date export information for the given package]" \
"-find[identify the named packages but not resolve their dependencies]" \
"-test[report not only the named packages but also their test binaries]" \
"-m[list modules instead of packages]" \
"-u[adds information about available upgrades]" \
"-versions[set the Module's Versions field to a list of all known versions of that module]:number" \
"*:importpaths:__go_packages"
;;
mod)
typeset -a mod_commands
mod_commands+=(
'download[download modules to local cache]'
'edit[edit go.mod from tools or scripts]'
'graph[print module requirement graph]'
'init[initialize new module in current directory]'
'tidy[add missing and remove unused modules]'
'vendor[make vendored copy of dependencies]'
'verify[verify dependencies have expected content]'
'why[explain why packages or modules are needed]'
)
if (( CURRENT == 3 )); then
_values 'go mod commands' ${mod_commands[@]} "help[display help]"
return
fi
case ${words[3]} in
help)
_values 'go mod commands' ${mod_commands[@]}
;;
download)
_arguments -s -w : \
"-json[print a sequence of JSON objects standard output]" \
"*:flags"
;;
edit)
_arguments -s -w : \
"-fmt[reformat the go.mod file]" \
"-module[change the module's path]" \
"-replace[=old{@v}=new{@v} add a replacement of the given module path and version pair]:name" \
"-dropreplace[=old{@v}=new{@v} drop a replacement of the given module path and version pair]:name" \
"-go[={version} set the expected Go language version]:number" \
"-print[print the final go.mod in its text format]" \
"-json[print the final go.mod file in JSON format]" \
"*:flags"
;;
graph)
;;
init)
;;
tidy)
_arguments -s -w : \
"-v[print information about removed modules]" \
"*:flags"
;;
vendor)
_arguments -s -w : \
"-v[print the names of vendored]" \
"*:flags"
;;
verify)
;;
why)
_arguments -s -w : \
"-m[treats the arguments as a list of modules and finds a path to any package in each of the modules]" \
"-vendor[exclude tests of dependencies]" \
"*:importpaths:__go_packages"
;;
esac
;;
help) help)
_values "${commands[@]}" \ _values "${commands[@]}" \
'environment[show Go environment variables available]' \
'gopath[GOPATH environment variable]' \ 'gopath[GOPATH environment variable]' \
'packages[description of package lists]' \ 'packages[description of package lists]' \
'remote[remote import path syntax]' \ 'remote[remote import path syntax]' \
...@@ -135,7 +212,7 @@ __go_tool_complete() { ...@@ -135,7 +212,7 @@ __go_tool_complete() {
run) run)
_arguments -s -w : \ _arguments -s -w : \
${build_flags[@]} \ ${build_flags[@]} \
'*:file:_path_files -g "*.go"' '*:file:_files -g "*.go"'
;; ;;
tool) tool)
if (( CURRENT == 3 )); then if (( CURRENT == 3 )); then
...@@ -184,10 +261,14 @@ alias gob='go build' ...@@ -184,10 +261,14 @@ alias gob='go build'
alias goc='go clean' alias goc='go clean'
alias god='go doc' alias god='go doc'
alias gof='go fmt' alias gof='go fmt'
alias gofa='go fmt . ./...' alias gofa='go fmt ./...'
alias gog='go get' alias gog='go get'
alias goi='go install' alias goi='go install'
alias gol='go list' alias gol='go list'
alias gom='go mod'
alias gop='cd $GOPATH'
alias gopb='cd $GOPATH/bin'
alias gops='cd $GOPATH/src'
alias gor='go run' alias gor='go run'
alias got='go test' alias got='go test'
alias gov='go vet' alias gov='go vet'
# gpg-agent
Enables [GPG's gpg-agent](https://www.gnupg.org/documentation/manuals/gnupg/) if it is not running.
To use it, add gpg-agent to the plugins array of your zshrc file:
```
plugins=(... gpg-agent)
```
local GPG_ENV=$HOME/.gnupg/gpg-agent.env # Enable gpg-agent if it is not running-
# --use-standard-socket will work from version 2 upwards
function start_agent_nossh { AGENT_SOCK=$(gpgconf --list-dirs | grep agent-socket | cut -d : -f 2)
eval $(/usr/bin/env gpg-agent --quiet --daemon --write-env-file ${GPG_ENV} 2> /dev/null)
chmod 600 ${GPG_ENV}
export GPG_AGENT_INFO
}
function start_agent_withssh { if [[ ! -S $AGENT_SOCK ]]; then
eval $(/usr/bin/env gpg-agent --quiet --daemon --enable-ssh-support --write-env-file ${GPG_ENV} 2> /dev/null) gpg-agent --daemon --use-standard-socket &>/dev/null
chmod 600 ${GPG_ENV}
export GPG_AGENT_INFO
export SSH_AUTH_SOCK
export SSH_AGENT_PID
}
# check if another agent is running
if ! gpg-connect-agent --quiet /bye > /dev/null 2> /dev/null; then
# source settings of old agent, if applicable
if [ -f "${GPG_ENV}" ]; then
. ${GPG_ENV} > /dev/null
export GPG_AGENT_INFO
export SSH_AUTH_SOCK
export SSH_AGENT_PID
fi
# check again if another agent is running using the newly sourced settings
if ! gpg-connect-agent --quiet /bye > /dev/null 2> /dev/null; then
# check for existing ssh-agent
if ssh-add -l > /dev/null 2> /dev/null; then
# ssh-agent running, start gpg-agent without ssh support
start_agent_nossh;
else
# otherwise start gpg-agent with ssh support
start_agent_withssh;
fi
fi
fi fi
export GPG_TTY=$TTY
GPG_TTY=$(tty) # Set SSH to use gpg-agent if it's enabled
export GPG_TTY GNUPGCONFIG="${GNUPGHOME:-"$HOME/.gnupg"}/gpg-agent.conf"
if [[ -r $GNUPGCONFIG ]] && command grep -q enable-ssh-support "$GNUPGCONFIG"; then
export SSH_AUTH_SOCK="$AGENT_SOCK.ssh"
unset SSH_AGENT_PID
fi
## Gradle Plugin
This plugin adds completions and aliases for [Gradle](https://gradle.org/).
To use it, add `gradle` to the plugins array in your zshrc file:
```zsh
plugins=(... gradle)
```
## Usage
This plugin creates an alias `gradle` which is used to determine whether the current working directory has a gradlew file. If gradlew is present it will be used otherwise `gradle` is used directly. Gradle tasks can be executed directly without regard for whether it is `gradle` or `gradlew`
Examples:
```zsh
gradle test
gradle build
```
## Completion
The completion provided for this plugin caches the parsed tasks into a file named `.gradletasknamecache` in the current working directory, so you might want to add that to your `.gitignore` file so that it's not accidentally committed.
############################################################################## ##############################################################################
# A descriptive listing of core Gradle commands # A descriptive listing of core Gradle commands
############################################################################ ############################################################################
gradle-or-gradlew() {
if [ -f ./gradlew ] ; then
echo "executing gradlew instead of gradle";
./gradlew "$@";
else
gradle "$@";
fi
}
alias gradle=gradle-or-gradlew;
function _gradle_core_commands() { function _gradle_core_commands() {
local ret=1 state local ret=1 state
_arguments ':subcommand:->subcommand' && ret=0 _arguments ':subcommand:->subcommand' && ret=0
...@@ -24,29 +36,60 @@ function _gradle_core_commands() { ...@@ -24,29 +36,60 @@ function _gradle_core_commands() {
function _gradle_arguments() { function _gradle_arguments() {
_arguments -C \ _arguments -C \
'-a[Do not rebuild project dependencies]' \ '-a[Do not rebuild project dependencies]' \
'-h[Help]' \ '-b[Specifies the build file]' \
'-D[System property]' \ '-c[Specifies the settings file]' \
'-d[Log at the debug level]' \ '-d[Log at the debug level]' \
'--gui[Launches the Gradle GUI app]' \ '-g[Specifies the Gradle user home directory]' \
'--stop[Stop the Gradle daemon]' \ '-h[Shows a help message]' \
'--daemon[Use the Gradle daemon]' \ '-i[Set log level to INFO]' \
'--no-daemon[Do not use the Gradle daemon]' \ '-m[Runs the build with all task actions disabled]' \
'--rerun-task [Specifies that any task optimization is ignored.]' \ '-p[Specifies the start directory for Gradle]' \
'-i[Log at the info level]' \ '-q[Log errors only]' \
'-m[Dry run]' \ '-s[Print out the stacktrace also for user exceptions]' \
'-P[Set a project property]' \ '-t[Continuous mode. Automatically re-run build after changes]' \
'-p[Specifies the start directory]' \ '-u[Don''t search in parent directories for a settings.gradle file]' \
'--profile[Profile the build time]' \ '-v[Prints Gradle version info]' \
'-q[Log at the quiet level (only show errors)]' \
'-v[Print the Gradle version info]' \
'-x[Specify a task to be excluded]' \ '-x[Specify a task to be excluded]' \
'-b[Specifies the build file.]' \ '-D[Set a system property]' \
'-c[Specifies the settings file.]' \ '-I[Specifies an initialization script]' \
'--continue[Continues task execution after a task failure.]' \ '-P[Sets a project property of the root project]' \
'-g[Specifies the Gradle user home directory.]' \ '-S[Print out the full (very verbose) stacktrace]' \
'-I[Specifies an initialization script.]' \ '--build-file[Specifies the build file]' \
'--refresh-dependencies[Refresh the state of dependencies.]' \ '--configure-on-demand[Only relevant projects are configured]' \
'-u[Don''t search in parent directories for a settings.gradle file.]' \ '--console[Type of console output to generate (plain, auto, or rich)]' \
'--continue[Continues task execution after a task failure]' \
'--continuous[Continuous mode. Automatically re-run build after changes]' \
'--daemon[Use the Gradle Daemon]' \
'--debug[Log at the debug level]' \
'--dry-run[Runs the build with all task actions disabled]' \
'--exclude-task[Specify a task to be excluded]' \
'--full-stacktrace[Print out the full (very verbose) stacktrace]' \
'--gradle-user-home[Specifies the Gradle user home directory]' \
'--gui[Launches the Gradle GUI app (Deprecated)]' \
'--help[Shows a help message]' \
'--include-build[Run the build as a composite, including the specified build]' \
'--info[Set log level to INFO]' \
'--init-script[Specifies an initialization script]' \
'--max-workers[Set the maximum number of workers that Gradle may use]' \
'--no-daemon[Do not use the Gradle Daemon]' \
'--no-rebuild[Do not rebuild project dependencies]' \
'--no-search-upwards[Don''t search in parent directories for a settings.gradle file]' \
'--offline[Build without accessing network resources]' \
'--parallel[Build projects in parallel]' \
'--profile[Profile build time and create report]' \
'--project-cache-dir[Specifies the project-specific cache directory]' \
'--project-dir[Specifies the start directory for Gradle]' \
'--project-prop[Sets a project property of the root project]' \
'--quiet[Log errors only]' \
'--recompile-scripts[Forces scripts to be recompiled, bypassing caching]' \
'--refresh-dependencies[Refresh the state of dependencies]' \
'--rerun-task[Specifies that any task optimization is ignored]' \
'--settings-file[Specifies the settings file]' \
'--stacktrace[Print out the stacktrace also for user exceptions]' \
'--status[Print Gradle Daemon status]' \
'--stop[Stop all Gradle Daemons]' \
'--system-prop[Set a system property]' \
'--version[Prints Gradle version info]' \
'*::command:->command' \ '*::command:->command' \
&& return 0 && return 0
} }
...@@ -57,11 +100,11 @@ function _gradle_arguments() { ...@@ -57,11 +100,11 @@ function _gradle_arguments() {
# and if so, regenerate the .gradle_tasks cache file # and if so, regenerate the .gradle_tasks cache file
############################################################################ ############################################################################
_gradle_does_task_list_need_generating () { _gradle_does_task_list_need_generating () {
[[ ! -f .gradletasknamecache ]] || [[ build.gradle -nt .gradletasknamecache ]] [[ ! -f .gradletasknamecache ]] || [[ build.gradle -nt .gradletasknamecache || build.gradle.kts -nt .gradletasknamecache ]]
} }
############## ##############
# Parse the tasks from `gradle(w) tasks --all` into .gradletasknamecache # Parse the tasks from `gradle(w) tasks --all` and return them to the calling function.
# All lines in the output from gradle(w) that are between /^-+$/ and /^\s*$/ # All lines in the output from gradle(w) that are between /^-+$/ and /^\s*$/
# are considered to be tasks. If and when gradle adds support for listing tasks # are considered to be tasks. If and when gradle adds support for listing tasks
# for programmatic parsing, this method can be deprecated. # for programmatic parsing, this method can be deprecated.
...@@ -76,7 +119,7 @@ _gradle_parse_tasks () { ...@@ -76,7 +119,7 @@ _gradle_parse_tasks () {
task_name_buffer="" task_name_buffer=""
elif [[ $line =~ ^\s*$ ]]; then elif [[ $line =~ ^\s*$ ]]; then
if [[ "$lines_might_be_tasks" = true ]]; then if [[ "$lines_might_be_tasks" = true ]]; then
# If a newline is found, send the buffer to .gradletasknamecache # If a newline is found, echo the buffer to the calling function
while read -r task; do while read -r task; do
echo $task | awk '/[a-zA-Z0-9:-]+/ {print $1}' echo $task | awk '/[a-zA-Z0-9:-]+/ {print $1}'
done <<< "$task_name_buffer" done <<< "$task_name_buffer"
...@@ -90,24 +133,43 @@ _gradle_parse_tasks () { ...@@ -90,24 +133,43 @@ _gradle_parse_tasks () {
done <<< "$1" done <<< "$1"
} }
##############
# Gradle tasks from subprojects are allowed to be executed without specifying
# the subproject; that task will then be called on all subprojects.
# gradle(w) tasks --all only lists tasks per subproject, but when autocompleting
# we often want to be able to run a specific task on all subprojects, e.g.
# "gradle clean".
# This function uses the list of tasks from "gradle tasks --all", and for each
# line grabs everything after the last ":" and combines that output with the original
# output. The combined list is returned as the result of this function.
##############
_gradle_parse_and_extract_tasks () {
# All tasks
tasks=$(_gradle_parse_tasks "$1")
# Task name without sub project(s) prefix
simple_tasks=$(echo $tasks | awk 'BEGIN { FS = ":" } { print $NF }')
echo "$tasks\n$simple_tasks"
}
############################################################################## ##############################################################################
# Discover the gradle tasks by running "gradle tasks --all" # Discover the gradle tasks by running "gradle tasks --all"
############################################################################ ############################################################################
_gradle_tasks () { _gradle_tasks () {
if [[ -f build.gradle ]]; then if [[ -f build.gradle || -f build.gradle.kts || -f settings.gradle || -f settings.gradle.kts ]]; then
_gradle_arguments _gradle_arguments
if _gradle_does_task_list_need_generating; then if _gradle_does_task_list_need_generating; then
_gradle_parse_tasks "$(gradle tasks --all)" > .gradletasknamecache _gradle_parse_and_extract_tasks "$(gradle tasks --all)" > .gradletasknamecache
fi fi
compadd -X "==== Gradle Tasks ====" $(cat .gradletasknamecache) compadd -X "==== Gradle Tasks ====" $(cat .gradletasknamecache)
fi fi
} }
_gradlew_tasks () { _gradlew_tasks () {
if [[ -f build.gradle ]]; then if [[ -f build.gradle || -f build.gradle.kts || -f settings.gradle || -f settings.gradle.kts ]]; then
_gradle_arguments _gradle_arguments
if _gradle_does_task_list_need_generating; then if _gradle_does_task_list_need_generating; then
_gradle_parse_tasks "$(./gradlew tasks --all)" > .gradletasknamecache _gradle_parse_and_extract_tasks "$(./gradlew tasks --all)" > .gradletasknamecache
fi fi
compadd -X "==== Gradlew Tasks ====" $(cat .gradletasknamecache) compadd -X "==== Gradlew Tasks ====" $(cat .gradletasknamecache)
fi fi
...@@ -119,3 +181,4 @@ _gradlew_tasks () { ...@@ -119,3 +181,4 @@ _gradlew_tasks () {
############################################################################ ############################################################################
compdef _gradle_tasks gradle compdef _gradle_tasks gradle
compdef _gradlew_tasks gradlew compdef _gradlew_tasks gradlew
compdef _gradlew_tasks gw
# Grails plugin
This plugin adds completion for the [Grails 2 CLI](https://grails.github.io/grails2-doc/2.5.x/guide/commandLine.html)
To use it, add `grails` to the plugins array in your zshrc file:
```zsh
plugins=(... grails)
```
It looks for scripts in the following paths:
- `$GRAILS_HOME/scripts`
- `~/.grails/scripts`
- `./scripts`
- `./plugins/*/scripts`
## Grails Commands
- `add-proxy`
- `alias`
- `bootstrap`
- `bug-report`
- `clean`
- `clean-all`
- `clear-proxy`
- `compile`
- `console`
- `create-app`
- `create-controller`
- `create-domain-class`
- `create-filters`
- `create-integration-test`
- `create-multi-project-build`
- `create-plugin`
- `create-pom`
- `create-script`
- `create-service`
- `create-tag-lib`
- `create-unit-test`
- `dependency-report`
- `doc`
- `help`
- `init`
- `install-app-templates`
- `install-dependency`
- `install-plugin`
- `install-templates`
- `integrate-with`
- `interactive`
- `list-plugin-updates`
- `list-plugins`
- `migrate-docs`
- `package`
- `package-plugin`
- `plugin-info`
- `refresh-dependencies`
- `remove-proxy`
- `run-app`
- `run-script`
- `run-war`
- `set-grails-version`
- `set-proxy`
- `set-version`
- `shell`
- `stats`
- `stop-app`
- `test-app`
- `uninstall-plugin`
- `url-mappings-report`
- `war`
- `wrapper`
# grunt plugin
This plugin adds completions for [grunt](https://github.com/gruntjs/grunt).
To use it, add `grunt` to the plugins array of your `.zshrc` file:
```zsh
plugins=(... grunt)
```
## Enable caching
If you want to use the cache, set the following in your `.zshrc`:
```zsh
zstyle ':completion:*' use-cache yes
```
## Settings
* Show grunt file path:
```zsh
zstyle ':completion::complete:grunt::options:' show_grunt_path yes
```
* Cache expiration days (default: 7):
```zsh
zstyle ':completion::complete:grunt::options:' expire 1
```
* Not update options cache if target gruntfile is changed.
```zsh
zstyle ':completion::complete:grunt::options:' no_update_options yes
```
Note that if you change the zstyle settings, you should delete the cache file and restart zsh.
```zsh
$ rm ~/.zcompcache/grunt
$ exec zsh
```
# gulp plugin
This plugin adds autocompletion for your [`gulp`](https://gulpjs.com/) tasks. It grabs all available tasks from the `gulpfile.js` in the current directory.
To use it, add `gulp` to the plugins array of your `.zshrc` file:
```
plugins=(... gulp)
```
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# #
# André König # André König
# Github: https://github.com/akoenig # GitHub: https://github.com/akoenig
# Twitter: https://twitter.com/caiifr # Twitter: https://twitter.com/caiifr
# #
...@@ -19,11 +19,11 @@ ...@@ -19,11 +19,11 @@
# Grabs all available tasks from the `gulpfile.js` # Grabs all available tasks from the `gulpfile.js`
# in the current directory. # in the current directory.
# #
function $$gulp_completion { function _gulp_completion {
compls=$(gulp --tasks-simple 2>/dev/null) compls=$(gulp --tasks-simple 2>/dev/null)
completions=(${=compls}) completions=(${=compls})
compadd -- $completions compadd -- $completions
} }
compdef $$gulp_completion gulp compdef _gulp_completion gulp
# Hanami Plugin #
This plugin adds convenient ways to work with [Hanami](https://hanamirb.org/) via console.
It's inspired by Rails plugin, so if you've used it, you'll feel like home.
## Usage ##
For example, type `hc` into your console when you're within Hanami project directory to run
the application console. Have a look at available shortcuts below. You can read more about
these commands [on the official website](https://hanamirb.org/guides/command-line/applications/).
## Aliases ##
| Alias | Command | Description |
|-------|---------------------------|---------------------------------------------------------|
| HED | HANAMI_ENV=development | Set environment variable HANAMI_ENV to development |
| HEP | HANAMI_ENV=production | Set environment variable HANAMI_ENV to production |
| HET | HANAMI_ENV=test | Set environment variable HANAMI_ENV to test |
| hc | hanami console | Run application console |
| hd | hanami destroy | Remove specified hanami resource |
| hg | hanami generate | Create specified hanami resource |
| hgm | hanami generate migration | Create migration file |
| hs | hanami server | Launch server with hanami application |
| hsp | hanami server -p | Launch server with specified port |
| hr | hanami routes | List application routes |
| hdc | hanami db create | Create application database |
| hdd | hanami db drop | Delete application database |
| hdp | hanami db prepare | Prepare database for the current environment |
| hda | hanami db apply | Recreates a fresh schema after migrations (destructive) |
| hdv | hanami db version | Print current database version |
| hdrs | hdd && hdp | Drop and recreate application database |
| hdtp | HET hdp | Actualize test environment database |
| hrg | hr &#124; grep | Grep hanami routes with specified pattern |
alias -g HED='HANAMI_ENV=development'
alias -g HEP='HANAMI_ENV=production'
alias -g HET='HANAMI_ENV=test'
alias hc='hanami console'
alias hd='hanami destroy'
alias hg='hanami generate'
alias hgm='hanami generate migration'
alias hs='hanami server'
alias hsp='hanami server -p'
alias hr='hanami routes'
alias hdc='hanami db create'
alias hdd='hanami db drop'
alias hdp='hanami db prepare'
alias hda='hanami db apply'
alias hdv='hanami db version'
alias hdrs='hdd && hdp'
alias hdtp='HET hdp'
alias hrg='hr | grep'
# Helm plugin
This plugin adds completion for [Helm](https://helm.sh/), the Kubernetes package manager.
To use it, add `helm` to the plugins array in your zshrc file:
```zsh
plugins=(... helm)
```
# Autocompletion for helm.
#
# Copy from kubectl : https://github.com/pstadler
if [ $commands[helm] ]; then
source <(helm completion zsh)
fi
# Heroku
This plugin provides completion for the [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli).
To use it add heroku to the plugins array in your zshrc file:
```bash
plugins=(... heroku)
```
#compdef heroku
# Heroku Autocomplete plugin for Oh-My-Zsh
# Requires: The Heroku client gem (https://github.com/heroku/heroku)
# Author: Ali B. (http://awhitebox.com)
local -a _1st_arguments
_1st_arguments=(
"account\:confirm_billing":"Confirm that your account can be billed at the end of the month"
"addons":"list installed addons"
"addons\:list":"list all available addons"
"addons\:add":"install an addon"
"addons\:upgrade":"upgrade an existing addon"
"addons\:downgrade":"downgrade an existing addon"
"addons\:remove":"uninstall an addon"
"addons\:open":"open an addon's dashboard in your browser"
"apps":"list your apps"
"apps\:info":"show detailed app information"
"apps\:create":"create a new app"
"apps\:rename":"rename the app"
"apps\:open":"open the app in a web browser"
"apps\:destroy":"permanently destroy an app"
"auth\:login":"log in with your heroku credentials"
"auth\:logout":"clear local authentication credentials"
"config":"display the config vars for an app"
"config\:pull":"pull heroku config vars down to the local environment"
"config\:push":"push local config vars to heroku"
"config\:set":"set one or more config vars"
"config\:unset":"unset one or more config vars"
"domains":"list custom domains for an app"
"domains\:add":"add a custom domain to an app"
"domains\:remove":"remove a custom domain from an app"
"domains\:clear":"remove all custom domains from an app"
"help":"list available commands or display help for a specific command"
"keys":"display keys for the current user"
"keys\:add":"add a key for the current user"
"keys\:remove":"remove a key from the current user"
"keys\:clear":"remove all authentication keys from the current user"
"logs":"display recent log output"
"logs\:cron":"DEPRECATED: display cron logs from legacy logging"
"logs\:drains":"manage syslog drains"
"maintenance\:on":"put the app into maintenance mode"
"maintenance\:off":"take the app out of maintenance mode"
"pg\:credentials":"display the DATABASE credentials"
"pg\:diagnose":"run diagnostics report on DATABASE"
"pg\:info":"display database information"
"pg\:kill":"kill a query"
"pg\:killall":"terminates ALL connections"
"pg\:maintenance":"manage maintenance for DATABASE"
"pg\:promote":"sets DATABASE as your DATABASE_URL"
"pg\:ps":"view active queries with execution time"
"pg\:psql":"open a psql shell to the database"
"pg\:pull":"pull from REMOTE_SOURCE_DATABASE to LOCAL_TARGET_DATABASE"
"pg\:push":"push from LOCAL_SOURCE_DATABASE to REMOTE_TARGET_DATABASE"
"pg\:reset":"delete all data in DATABASE"
"pg\:unfollow":"stop a replica from following and make it a read/write database"
"pg\:upgrade":"unfollow a database and upgrade it to the latest PostgreSQL version"
"pg\:wait":"monitor database creation, exit when complete"
"pgbackups":"list captured backups"
"pgbackups\:url":"get a temporary URL for a backup"
"pgbackups\:capture":"capture a backup from a database id"
"pgbackups\:restore":"restore a backup to a database"
"pgbackups\:destroy":"destroys a backup"
"plugins":"list installed plugins"
"plugins\:install":"install a plugin"
"plugins\:uninstall":"uninstall a plugin"
"ps\:dynos":"scale to QTY web processes"
"ps\:workers":"scale to QTY background processes"
"ps":"list processes for an app"
"ps\:restart":"restart an app process"
"ps\:scale":"scale processes by the given amount"
"releases":"list releases"
"releases\:info":"view detailed information for a release"
"rollback":"roll back to an older release"
"run":"run an attached process"
"run\:rake":"remotely execute a rake command"
"run\:console":"open a remote console session"
"sharing":"list collaborators on an app"
"sharing\:add":"add a collaborator to an app"
"sharing\:remove":"remove a collaborator from an app"
"sharing\:transfer":"transfer an app to a new owner"
"ssl":"list certificates for an app"
"ssl\:add":"add an ssl certificate to an app"
"ssl\:remove":"remove an ssl certificate from an app"
"ssl\:clear":"remove all ssl certificates from an app"
"stack":"show the list of available stacks"
"stack\:migrate":"prepare migration of this app to a new stack"
"version":"show heroku client version"
)
_arguments '*:: :->command'
if (( CURRENT == 1 )); then
_describe -t commands "heroku command" _1st_arguments
return
fi
local -a _command_args
case "$words[1]" in
apps:info)
_command_args=(
'(-r|--raw)'{-r,--raw}'[output info as raw key/value pairs]' \
)
;;
apps:create)
_command_args=(
'(-a|--addons)'{-a,--addons}'[a list of addons to install]' \
'(-r|--remote)'{-r,--remote}'[the git remote to create, default "heroku"]' \
'(-s|--stack)'{-s,--stack}'[the stack on which to create the app]' \
)
;;
config)
_command_args=(
'(-s|--shell)'{-s,--shell}'[output config vars in shell format]' \
)
;;
keys)
_command_args=(
'(-l|--long)'{-l,--long}'[display extended information for each key]' \
)
;;
logs)
_command_args=(
'(-n|--num)'{-n,--num}'[the number of lines to display]' \
'(-p|--ps)'{-p,--ps}'[only display logs from the given process]' \
'(-s|--source)'{-s,--source}'[only display logs from the given source]' \
'(-t|--tail)'{-t,--tail}'[continually stream logs]' \
)
;;
pgbackups:capture)
_command_args=(
'(-e|--expire)'{-e,--expire}'[if no slots are available to capture, delete the oldest backup to make room]' \
)
;;
stack)
_command_args=(
'(-a|--all)'{-a,--all}'[include deprecated stacks]' \
)
;;
esac
_arguments \
$_command_args \
'(--app)--app[the app name]' \
'(--remote)--remote[the remote name]' \
'(--help)--help[help about the current command]' \
&& return 0
HEROKU_AC_CACHE_DIR="$HOME/.cache"
if [ "$(uname -s)" = "Darwin" ]; then
HEROKU_AC_CACHE_DIR="$HOME/Library/Caches"
fi
if [ ! -z "$XDG_CACHE_HOME" ]; then
HEROKU_AC_CACHE_DIR="$XDG_CACHE_DIR"
fi
HEROKU_AC_ZSH_SETUP_PATH=$HEROKU_AC_CACHE_DIR/heroku/autocomplete/zsh_setup
[ -f $HEROKU_AC_ZSH_SETUP_PATH ] && source $HEROKU_AC_ZSH_SETUP_PATH
...@@ -6,9 +6,9 @@ feature, where you can type in any part of any previously entered command ...@@ -6,9 +6,9 @@ feature, where you can type in any part of any previously entered command
and press the UP and DOWN arrow keys to cycle through the matching commands. and press the UP and DOWN arrow keys to cycle through the matching commands.
You can also use K and J in VI mode or ^P and ^N in EMACS mode for the same. You can also use K and J in VI mode or ^P and ^N in EMACS mode for the same.
[1]: http://fishshell.com [1]: https://fishshell.com
[2]: http://www.zsh.org/mla/users/2009/msg00818.html [2]: https://www.zsh.org/mla/users/2009/msg00818.html
[3]: http://sourceforge.net/projects/fizsh/ [3]: https://sourceforge.net/projects/fizsh/
[4]: https://github.com/robbyrussell/oh-my-zsh/pull/215 [4]: https://github.com/robbyrussell/oh-my-zsh/pull/215
[5]: https://github.com/zsh-users/zsh-history-substring-search [5]: https://github.com/zsh-users/zsh-history-substring-search
[6]: https://github.com/zsh-users/zsh-syntax-highlighting [6]: https://github.com/zsh-users/zsh-syntax-highlighting
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment