From bab54e22d241cac64efea930963b6b4ddaa70aa9 Mon Sep 17 00:00:00 2001 From: Lunaetic Date: Tue, 29 Dec 2020 10:35:16 -0500 Subject: [PATCH 1/2] Add zsh autocompletion definition that parses commands from usage --- autocompletion/zsh/warden.plugin.zsh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 autocompletion/zsh/warden.plugin.zsh diff --git a/autocompletion/zsh/warden.plugin.zsh b/autocompletion/zsh/warden.plugin.zsh new file mode 100644 index 00000000..d1d41bf8 --- /dev/null +++ b/autocompletion/zsh/warden.plugin.zsh @@ -0,0 +1,20 @@ +#compdef warden + +# Installation +# ============ +# +# Copy this file, `warden.plugin.zsh`, to `~/.oh-my-zsh/plugins/custom/warden/` +# +# 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 From 8f6b43e2ab5d292607a84e165e87913908d6c801 Mon Sep 17 00:00:00 2001 From: Lunaetic Date: Tue, 29 Dec 2020 10:50:13 -0500 Subject: [PATCH 2/2] Correct typo in blackfire.cmd Add 'sync' and 'vnc' commands to usage.help --- commands/blackfire.cmd | 2 +- commands/usage.help | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/commands/blackfire.cmd b/commands/blackfire.cmd index cb7db951..61ced9cf 100644 --- a/commands/blackfire.cmd +++ b/commands/blackfire.cmd @@ -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} diff --git a/commands/usage.help b/commands/usage.help index 6a34475b..23fba7c4 100755 --- a/commands/usage.help +++ b/commands/usage.help @@ -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 <