Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add zsh autocompletion definition #280

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions autocompletion/zsh/warden.plugin.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#compdef warden

# Installation
# ============
#
# Copy this file, `warden.plugin.zsh`, to `~/.oh-my-zsh/plugins/custom/warden/`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe better to create a symlink? So if the file will update in next releases, it will be automatically updated there as well.

#
# Enable the plugin by adding `warden` to `plugins=(… warden)` in `~/.zshrc`
#
# Reload your zsh session, or source `~/.zshrc`

_warden_get_command_list() {
warden | sed -n '/Commands:/,$p' | sed '1d' | awk '{print $1}'
}

_warden() {
compadd `_warden_get_command_list`
}

compdef _warden warden
2 changes: 1 addition & 1 deletion commands/blackfire.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
WARDEN_ENV_PATH="$(locateEnvPath)" || exit $?
loadEnvConfig "${WARDEN_ENV_PATH}" || exit $?

## set defaults for this command which can be overriden either using exports in the user
## set defaults for this command which can be overridden either using exports in the user
## profile or setting them in the .env configuration on a per-project basis
WARDEN_ENV_BLACKFIRE_COMMAND=${WARDEN_ENV_BLACKFIRE_COMMAND:-blackfire}
WARDEN_ENV_BLACKFIRE_CONTAINER=${WARDEN_ENV_BLACKFIRE_CONTAINER:-php-blackfire}
Expand Down
8 changes: 5 additions & 3 deletions commands/usage.help
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
[[ ! ${WARDEN_DIR} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1

WARDEN_HEADER='
_ __ __
| | / /___ __________/ /__ ____
_ __ __
| | / /___ __________/ /__ ____
| | /| / / __ `/ ___/ __ / _ \/ __ \
| |/ |/ / /_/ / / / /_/ / __/ / / /
|__/|__/\__,_/_/ \__,_/\___/_/ /_/
|__/|__/\__,_/_/ \__,_/\___/_/ /_/
'

WARDEN_USAGE=$(cat <<EOF
Expand All @@ -28,6 +28,8 @@ Warden version $(cat ${WARDEN_DIR}/version)
shell Launches into a shell within the current project environment
debug Launches debug enabled shell within current project environment
sign-certificate Signs a wildcard certificate including all passed hostnames on the SAN list
sync Controls the mutagen session (if using mutagen; see 'warden sync -h' for details)
vnc Establishes vnc sessions (see 'warden vnc -h' for details)
version Show version information
EOF
)