diff --git a/zap.zsh b/zap.zsh index 13bc475..b91379c 100644 --- a/zap.zsh +++ b/zap.zsh @@ -75,6 +75,9 @@ function _zap_update() { local _plugin _plug _status + [[ $1 = "self" ]] && { _pull $ZAP_DIR; return } + [[ $1 == "all" ]] && { echo "\nUpdating All Plugins\n"; for _plug in ${ZAP_INSTALLED_PLUGINS[@]}; do _pull "$ZAP_PLUGIN_DIR/$_plug"; done; return } + function _check() { git -C "$1" remote update &> /dev/null case $(LANG=en_US git -C "$1" status -uno | grep -Eo '(ahead|behind|up to date)') in @@ -117,14 +120,18 @@ function _zap_update() { function _zap_help() { echo "⚡ Zap - Help -Usage: zap +Usage: zap [options] COMMANDS: - clean Remove unused plugins - help Show this help message - list List plugins - update Update plugins - version Show version information" + clean Remove unused plugins + help Show this help message + list List plugins + update Update plugins + version Show version information + +OPTIONS: + update self Update Zap itself + update all Update all plugins" } function _zap_version() { @@ -144,7 +151,7 @@ function zap() { version "_zap_version" ) emulate -L zsh - [[ -z "$subcmds[$1]" ]] && { _zap_help; return 1 } || ${subcmds[$1]} + [[ -z "$subcmds[$1]" ]] && { _zap_help; return 1 } || ${subcmds[$1]} $2 } # vim: ft=zsh ts=4 et @@ -155,3 +162,6 @@ function zap() { # 13: Failed to checkout # 14: Failed to pull # 15: Nothing to remove + + +