Add `-v` (verbose) option

so the normal output is focused on the given action, and output for
additional steps perfomed after the given action is only shown in
verbose mode.

Also, the output of wget is only shown in verbose mode. This is because
wget always shows some output (to stderr) even when there are no errors.
See https://serverfault.com/q/70889/302338

This should give a friendlier output.
See #360
This commit is contained in:
Eric Nielsen 2020-01-11 16:23:11 -05:00
parent b9bca2d325
commit ee99fe8a36
No known key found for this signature in database
GPG Key ID: 47D1DBFA0765A1FB
12 changed files with 82 additions and 46 deletions

View File

@ -1,5 +1,5 @@
_zimfw_print() { _zimfw_print() {
if (( ! _zquiet )); then if (( _zprintlevel > 0 )); then
print "${@}" print "${@}"
fi fi
} }

View File

@ -98,7 +98,7 @@ Startup options:
done done
if (( _zprepare_xargs )); then if (( _zprepare_xargs )); then
if (( ! zfrozen )); then if (( ! zfrozen )); then
_zmodules_xargs+=${zmodule}$'\0'${zdir}$'\0'${zurl}$'\0'${ztype}$'\0'${zrev}$'\0'${_zquiet}$'\0' _zmodules_xargs+=${zmodule}$'\0'${zdir}$'\0'${zurl}$'\0'${ztype}$'\0'${zrev}$'\0'${_zprintlevel}$'\0'
fi fi
else else
if (( zdisabled )); then if (( zdisabled )); then

View File

@ -1,6 +1,6 @@
_zimfw_clean_compiled() { _zimfw_clean_compiled() {
local zopt local zopt
(( ! _zquiet )) && zopt='-v' (( _zprintlevel > 0 )) && zopt='-v'
command find ${ZIM_HOME} \( -name '*.zwc' -o -name '*.zwc.old' \) -exec rm -f ${zopt} {} \; || return 1 command find ${ZIM_HOME} \( -name '*.zwc' -o -name '*.zwc.old' \) -exec rm -f ${zopt} {} \; || return 1
command rm -f ${zopt} <%= home %>/<%= startup_files_glob %>.zwc(|.old)(N) || return 1 command rm -f ${zopt} <%= home %>/<%= startup_files_glob %>.zwc(|.old)(N) || return 1
_zimfw_print -P '<%= done %>Done with clean-compiled. Run %Bzimfw compile%b to re-compile.' _zimfw_print -P '<%= done %>Done with clean-compiled. Run %Bzimfw compile%b to re-compile.'

View File

@ -1,7 +1,7 @@
_zimfw_clean_dumpfile() { _zimfw_clean_dumpfile() {
local zdumpfile zopt local zdumpfile zopt
zstyle -s ':zim:completion' dumpfile 'zdumpfile' || zdumpfile=<%= home %>/.zcompdump zstyle -s ':zim:completion' dumpfile 'zdumpfile' || zdumpfile=<%= home %>/.zcompdump
(( ! _zquiet )) && zopt='-v' (( _zprintlevel > 0 )) && zopt='-v'
command rm -f ${zopt} ${zdumpfile}(|.zwc(|.old))(N) || return 1 command rm -f ${zopt} ${zdumpfile}(|.zwc(|.old))(N) || return 1
_zimfw_print -P '<%= done %>Done with clean-dumpfile. Restart your terminal to dump an updated configuration.' _zimfw_print -P '<%= done %>Done with clean-dumpfile. Restart your terminal to dump an updated configuration.'
} }

View File

@ -1,3 +1,5 @@
_zimfw_compile() { _zimfw_compile() {
source ${ZIM_HOME}/login_init.zsh "${@}" local zopt
(( _zprintlevel <= 0 )) && zopt='-q'
source ${ZIM_HOME}/login_init.zsh ${zopt}
} }

View File

@ -1,6 +1,6 @@
_zimfw_uninstall() { _zimfw_uninstall() {
local zopt zdir zmodule local zopt zdir zmodule
(( ! _zquiet )) && zopt='-v' (( _zprintlevel > 0 )) && zopt='-v'
for zdir in ${ZIM_HOME}/modules/*(N/); do for zdir in ${ZIM_HOME}/modules/*(N/); do
zmodule=${zdir:t} zmodule=${zdir:t}
# If _zmodules and _zdisableds do not contain the zmodule # If _zmodules and _zdisableds do not contain the zmodule

View File

@ -3,7 +3,12 @@ _zimfw_upgrade() {
local -r zurl=https://raw.githubusercontent.com/zimfw/zimfw/master/zimfw.zsh local -r zurl=https://raw.githubusercontent.com/zimfw/zimfw/master/zimfw.zsh
{ {
if (( ${+commands[wget]} )); then if (( ${+commands[wget]} )); then
command wget -nv -O ${ztarget}.new ${zurl} || return 1 local zopt
(( _zprintlevel <= 1 )) && zopt='-q'
if ! command wget -nv ${zopt} -O ${ztarget}.new ${zurl}; then
(( _zprintlevel <= 1 )) && print -u2 -PR "%F{red}<%= error %>Error downloading %B${zurl}%b. Use %B-v%b option to see details.%f"
return 1
fi
else else
command curl -fsSL -o ${ztarget}.new ${zurl} || return 1 command curl -fsSL -o ${ztarget}.new ${zurl} || return 1
fi fi

View File

@ -1,6 +1,6 @@
zimfw() { zimfw() {
local -r zusage=" local -r zusage="
Usage: %B${0}%b <action> [%B-q%b] Usage: %B${0}%b <action> [%B-q%b|%B-v%b]
Actions: Actions:
%Bbuild%b Build init.zsh and login_init.zsh %Bbuild%b Build init.zsh and login_init.zsh
@ -16,16 +16,18 @@ Actions:
Options: Options:
%B-q%b Quiet, only outputs errors %B-q%b Quiet, only outputs errors
%B-v%b Verbose
" "
local ztool _zmodules_xargs local ztool _zmodules_xargs
local -a _zdisableds _zmodules _zfpaths _zfunctions _zscripts local -a _zdisableds _zmodules _zfpaths _zfunctions _zscripts
local -i _zquiet=0 local -i _zprintlevel=1
if (( # > 2 )); then if (( # > 2 )); then
print -u2 -PR "%F{red}${0}: Too many options%f"$'\n'${zusage} print -u2 -PR "%F{red}${0}: Too many options%f"$'\n'${zusage}
return 1 return 1
elif (( # > 1 )); then elif (( # > 1 )); then
case ${2} in case ${2} in
-q) _zquiet=1 ;; -q) _zprintlevel=0 ;;
-v) _zprintlevel=2 ;;
*) *)
print -u2 -PR "%F{red}${0}: Unknown option ${2}%f"$'\n'${zusage} print -u2 -PR "%F{red}${0}: Unknown option ${2}%f"$'\n'${zusage}
return 1 return 1
@ -43,21 +45,30 @@ Options:
esac esac
case ${1} in case ${1} in
build) _zimfw_source_zimrc && _zimfw_build && _zimfw_compile ${2} ;; build)
_zimfw_source_zimrc && _zimfw_build || return 1
(( _zprintlevel-- ))
_zimfw_compile
;;
init) _zimfw_source_zimrc && _zimfw_build ;; init) _zimfw_source_zimrc && _zimfw_build ;;
clean) _zimfw_clean_compiled && _zimfw_clean_dumpfile ;; clean) _zimfw_clean_compiled && _zimfw_clean_dumpfile ;;
clean-compiled) _zimfw_clean_compiled ;; clean-compiled) _zimfw_clean_compiled ;;
clean-dumpfile) _zimfw_clean_dumpfile ;; clean-dumpfile) _zimfw_clean_dumpfile ;;
compile) _zimfw_build_login_init && _zimfw_compile ${2} ;; compile) _zimfw_build_login_init && _zimfw_compile ;;
info) _zimfw_info ;; info) _zimfw_info ;;
install|update) install|update)
_zimfw_source_zimrc 1 || return 1 _zimfw_source_zimrc 1 || return 1
print -Rn ${_zmodules_xargs} | xargs -0 -n6 -P10 zsh -c ${ztool} ${1} && \ print -Rn ${_zmodules_xargs} | xargs -0 -n6 -P10 zsh -c ${ztool} ${1} && \
_zimfw_print -PR "<%= done %>Done with ${1}. Restart your terminal for any changes to take effect." && \ _zimfw_print -PR "<%= done %>Done with ${1}. Restart your terminal for any changes to take effect." || return 1
_zimfw_source_zimrc && _zimfw_build && _zimfw_compile ${2} (( _zprintlevel-- ))
_zimfw_source_zimrc && _zimfw_build && _zimfw_compile
;; ;;
uninstall) _zimfw_source_zimrc && _zimfw_uninstall ;; uninstall) _zimfw_source_zimrc && _zimfw_uninstall ;;
upgrade) _zimfw_upgrade && _zimfw_build_login_init && _zimfw_compile ${2} ;; upgrade)
_zimfw_upgrade || return 1
(( _zprintlevel-- ))
_zimfw_build_login_init && _zimfw_compile
;;
*) *)
print -u2 -PR "%F{red}${0}: Unknown action ${1}%f"$'\n'${zusage} print -u2 -PR "%F{red}${0}: Unknown action ${1}%f"$'\n'${zusage}
return 1 return 1

View File

@ -3,15 +3,15 @@ readonly MODULE=${1}
readonly DIR=${2} readonly DIR=${2}
readonly URL=${3} readonly URL=${3}
readonly REV=${5} readonly REV=${5}
readonly -i QUIET=${6} readonly -i PRINTLEVEL=${6}
readonly CLEAR_LINE=$'\E[2K\r' readonly CLEAR_LINE=$'\E[2K\r'
if [[ -e ${DIR} ]]; then if [[ -e ${DIR} ]]; then
# Already exists # Already exists
return 0 return 0
fi fi
(( ! QUIET )) && print -Rn ${CLEAR_LINE}"Installing ${MODULE}<%= ellipsis %>" (( PRINTLEVEL > 0 )) && print -Rn ${CLEAR_LINE}"Installing ${MODULE}<%= ellipsis %>"
if ERR=$(command git clone -b ${REV} -q --recursive ${URL} ${DIR} 2>&1); then if ERR=$(command git clone -b ${REV} -q --recursive ${URL} ${DIR} 2>&1); then
if (( ! QUIET )); then if (( PRINTLEVEL > 0 )); then
print -PR ${CLEAR_LINE}"<%= okay %>%B${MODULE}:%b Installed" print -PR ${CLEAR_LINE}"<%= okay %>%B${MODULE}:%b Installed"
fi fi
else else

View File

@ -4,9 +4,9 @@ readonly DIR=${2}
readonly URL=${3} readonly URL=${3}
readonly TYPE=${4} readonly TYPE=${4}
readonly REV=${5} readonly REV=${5}
readonly -i QUIET=${6} readonly -i PRINTLEVEL=${6}
readonly CLEAR_LINE=$'\E[2K\r' readonly CLEAR_LINE=$'\E[2K\r'
(( ! QUIET )) && print -Rn ${CLEAR_LINE}"Updating ${MODULE}<%= ellipsis %>" (( PRINTLEVEL > 0 )) && print -Rn ${CLEAR_LINE}"Updating ${MODULE}<%= ellipsis %>"
if ! builtin cd -q ${DIR} 2>/dev/null; then if ! builtin cd -q ${DIR} 2>/dev/null; then
print -u2 -PR ${CLEAR_LINE}"%F{red}<%= error %>%B${MODULE}:%b Not installed%f" print -u2 -PR ${CLEAR_LINE}"%F{red}<%= error %>%B${MODULE}:%b Not installed%f"
return 1 return 1
@ -21,7 +21,7 @@ if [[ ${URL} != $(command git config --get remote.origin.url) ]]; then
fi fi
if [[ ${TYPE} == tag ]]; then if [[ ${TYPE} == tag ]]; then
if [[ ${REV} == $(command git describe --tags --exact-match 2>/dev/null) ]]; then if [[ ${REV} == $(command git describe --tags --exact-match 2>/dev/null) ]]; then
(( ! QUIET )) && print -PR ${CLEAR_LINE}"<%= okay %>%B${MODULE}:%b Already up to date" (( PRINTLEVEL > 0 )) && print -PR ${CLEAR_LINE}"<%= okay %>%B${MODULE}:%b Already up to date"
return 0 return 0
fi fi
fi fi
@ -50,7 +50,7 @@ else
OUT="Updating to ${TYPE} ${REV}" OUT="Updating to ${TYPE} ${REV}"
fi fi
if ERR=$(command git submodule update --init --recursive -q 2>&1); then if ERR=$(command git submodule update --init --recursive -q 2>&1); then
if (( ! QUIET )); then if (( PRINTLEVEL > 0 )); then
[[ -n ${LOG} ]] && OUT=${OUT}$'\n'${(F):- ${(f)^LOG}} [[ -n ${LOG} ]] && OUT=${OUT}$'\n'${(F):- ${(f)^LOG}}
print -PR ${CLEAR_LINE}"<%= okay %>%B${MODULE}:%b ${OUT}" print -PR ${CLEAR_LINE}"<%= okay %>%B${MODULE}:%b ${OUT}"
fi fi

View File

@ -6,7 +6,7 @@ class Zim
@home = "${ZDOTDIR:-${HOME}}" @home = "${ZDOTDIR:-${HOME}}"
@min_zsh_version = "5.2" @min_zsh_version = "5.2"
@startup_files_glob = ".z(shenv|profile|shrc|login|logout)" @startup_files_glob = ".z(shenv|profile|shrc|login|logout)"
@version = "1.0.1" @version = "1.1.0-SNAPSHOT"
@ellipsis = " ..." @ellipsis = " ..."
@okay = "%F{green})%f " @okay = "%F{green})%f "
@error = "x " @error = "x "

View File

@ -33,7 +33,7 @@ fi
: ${ZIM_HOME=${0:A:h}} : ${ZIM_HOME=${0:A:h}}
_zimfw_print() { _zimfw_print() {
if (( ! _zquiet )); then if (( _zprintlevel > 0 )); then
print "${@}" print "${@}"
fi fi
} }
@ -200,7 +200,7 @@ Startup options:
done done
if (( _zprepare_xargs )); then if (( _zprepare_xargs )); then
if (( ! zfrozen )); then if (( ! zfrozen )); then
_zmodules_xargs+=${zmodule}$'\0'${zdir}$'\0'${zurl}$'\0'${ztype}$'\0'${zrev}$'\0'${_zquiet}$'\0' _zmodules_xargs+=${zmodule}$'\0'${zdir}$'\0'${zurl}$'\0'${ztype}$'\0'${zrev}$'\0'${_zprintlevel}$'\0'
fi fi
else else
if (( zdisabled )); then if (( zdisabled )); then
@ -239,7 +239,7 @@ _zimfw_source_zimrc() {
_zimfw_clean_compiled() { _zimfw_clean_compiled() {
local zopt local zopt
(( ! _zquiet )) && zopt='-v' (( _zprintlevel > 0 )) && zopt='-v'
command find ${ZIM_HOME} \( -name '*.zwc' -o -name '*.zwc.old' \) -exec rm -f ${zopt} {} \; || return 1 command find ${ZIM_HOME} \( -name '*.zwc' -o -name '*.zwc.old' \) -exec rm -f ${zopt} {} \; || return 1
command rm -f ${zopt} ${ZDOTDIR:-${HOME}}/.z(shenv|profile|shrc|login|logout).zwc(|.old)(N) || return 1 command rm -f ${zopt} ${ZDOTDIR:-${HOME}}/.z(shenv|profile|shrc|login|logout).zwc(|.old)(N) || return 1
_zimfw_print -P 'Done with clean-compiled. Run %Bzimfw compile%b to re-compile.' _zimfw_print -P 'Done with clean-compiled. Run %Bzimfw compile%b to re-compile.'
@ -248,17 +248,19 @@ _zimfw_clean_compiled() {
_zimfw_clean_dumpfile() { _zimfw_clean_dumpfile() {
local zdumpfile zopt local zdumpfile zopt
zstyle -s ':zim:completion' dumpfile 'zdumpfile' || zdumpfile=${ZDOTDIR:-${HOME}}/.zcompdump zstyle -s ':zim:completion' dumpfile 'zdumpfile' || zdumpfile=${ZDOTDIR:-${HOME}}/.zcompdump
(( ! _zquiet )) && zopt='-v' (( _zprintlevel > 0 )) && zopt='-v'
command rm -f ${zopt} ${zdumpfile}(|.zwc(|.old))(N) || return 1 command rm -f ${zopt} ${zdumpfile}(|.zwc(|.old))(N) || return 1
_zimfw_print -P 'Done with clean-dumpfile. Restart your terminal to dump an updated configuration.' _zimfw_print -P 'Done with clean-dumpfile. Restart your terminal to dump an updated configuration.'
} }
_zimfw_compile() { _zimfw_compile() {
source ${ZIM_HOME}/login_init.zsh "${@}" local zopt
(( _zprintlevel <= 0 )) && zopt='-q'
source ${ZIM_HOME}/login_init.zsh ${zopt}
} }
_zimfw_info() { _zimfw_info() {
print 'Zim version: 1.0.1 (previous commit is 28e4345)' print 'Zim version: 1.1.0-SNAPSHOT (previous commit is b9bca2d)'
print -R 'ZIM_HOME: '${ZIM_HOME} print -R 'ZIM_HOME: '${ZIM_HOME}
print -R 'Zsh version: '${ZSH_VERSION} print -R 'Zsh version: '${ZSH_VERSION}
print -R 'System info: '$(command uname -a) print -R 'System info: '$(command uname -a)
@ -266,7 +268,7 @@ _zimfw_info() {
_zimfw_uninstall() { _zimfw_uninstall() {
local zopt zdir zmodule local zopt zdir zmodule
(( ! _zquiet )) && zopt='-v' (( _zprintlevel > 0 )) && zopt='-v'
for zdir in ${ZIM_HOME}/modules/*(N/); do for zdir in ${ZIM_HOME}/modules/*(N/); do
zmodule=${zdir:t} zmodule=${zdir:t}
# If _zmodules and _zdisableds do not contain the zmodule # If _zmodules and _zdisableds do not contain the zmodule
@ -282,7 +284,12 @@ _zimfw_upgrade() {
local -r zurl=https://raw.githubusercontent.com/zimfw/zimfw/master/zimfw.zsh local -r zurl=https://raw.githubusercontent.com/zimfw/zimfw/master/zimfw.zsh
{ {
if (( ${+commands[wget]} )); then if (( ${+commands[wget]} )); then
command wget -nv -O ${ztarget}.new ${zurl} || return 1 local zopt
(( _zprintlevel <= 1 )) && zopt='-q'
if ! command wget -nv ${zopt} -O ${ztarget}.new ${zurl}; then
(( _zprintlevel <= 1 )) && print -u2 -PR "%F{red}x Error downloading %B${zurl}%b. Use %B-v%b option to see details.%f"
return 1
fi
else else
command curl -fsSL -o ${ztarget}.new ${zurl} || return 1 command curl -fsSL -o ${ztarget}.new ${zurl} || return 1
fi fi
@ -294,7 +301,7 @@ _zimfw_upgrade() {
zimfw() { zimfw() {
local -r zusage=" local -r zusage="
Usage: %B${0}%b <action> [%B-q%b] Usage: %B${0}%b <action> [%B-q%b|%B-v%b]
Actions: Actions:
%Bbuild%b Build init.zsh and login_init.zsh %Bbuild%b Build init.zsh and login_init.zsh
@ -310,16 +317,18 @@ Actions:
Options: Options:
%B-q%b Quiet, only outputs errors %B-q%b Quiet, only outputs errors
%B-v%b Verbose
" "
local ztool _zmodules_xargs local ztool _zmodules_xargs
local -a _zdisableds _zmodules _zfpaths _zfunctions _zscripts local -a _zdisableds _zmodules _zfpaths _zfunctions _zscripts
local -i _zquiet=0 local -i _zprintlevel=1
if (( # > 2 )); then if (( # > 2 )); then
print -u2 -PR "%F{red}${0}: Too many options%f"$'\n'${zusage} print -u2 -PR "%F{red}${0}: Too many options%f"$'\n'${zusage}
return 1 return 1
elif (( # > 1 )); then elif (( # > 1 )); then
case ${2} in case ${2} in
-q) _zquiet=1 ;; -q) _zprintlevel=0 ;;
-v) _zprintlevel=2 ;;
*) *)
print -u2 -PR "%F{red}${0}: Unknown option ${2}%f"$'\n'${zusage} print -u2 -PR "%F{red}${0}: Unknown option ${2}%f"$'\n'${zusage}
return 1 return 1
@ -334,15 +343,15 @@ readonly MODULE=\${1}
readonly DIR=\${2} readonly DIR=\${2}
readonly URL=\${3} readonly URL=\${3}
readonly REV=\${5} readonly REV=\${5}
readonly -i QUIET=\${6} readonly -i PRINTLEVEL=\${6}
readonly CLEAR_LINE=$'\E[2K\r' readonly CLEAR_LINE=$'\E[2K\r'
if [[ -e \${DIR} ]]; then if [[ -e \${DIR} ]]; then
# Already exists # Already exists
return 0 return 0
fi fi
(( ! QUIET )) && print -Rn \${CLEAR_LINE}\"Installing \${MODULE} ...\" (( PRINTLEVEL > 0 )) && print -Rn \${CLEAR_LINE}\"Installing \${MODULE} ...\"
if ERR=\$(command git clone -b \${REV} -q --recursive \${URL} \${DIR} 2>&1); then if ERR=\$(command git clone -b \${REV} -q --recursive \${URL} \${DIR} 2>&1); then
if (( ! QUIET )); then if (( PRINTLEVEL > 0 )); then
print -PR \${CLEAR_LINE}\"%F{green})%f %B\${MODULE}:%b Installed\" print -PR \${CLEAR_LINE}\"%F{green})%f %B\${MODULE}:%b Installed\"
fi fi
else else
@ -358,9 +367,9 @@ readonly DIR=\${2}
readonly URL=\${3} readonly URL=\${3}
readonly TYPE=\${4} readonly TYPE=\${4}
readonly REV=\${5} readonly REV=\${5}
readonly -i QUIET=\${6} readonly -i PRINTLEVEL=\${6}
readonly CLEAR_LINE=$'\E[2K\r' readonly CLEAR_LINE=$'\E[2K\r'
(( ! QUIET )) && print -Rn \${CLEAR_LINE}\"Updating \${MODULE} ...\" (( PRINTLEVEL > 0 )) && print -Rn \${CLEAR_LINE}\"Updating \${MODULE} ...\"
if ! builtin cd -q \${DIR} 2>/dev/null; then if ! builtin cd -q \${DIR} 2>/dev/null; then
print -u2 -PR \${CLEAR_LINE}\"%F{red}x %B\${MODULE}:%b Not installed%f\" print -u2 -PR \${CLEAR_LINE}\"%F{red}x %B\${MODULE}:%b Not installed%f\"
return 1 return 1
@ -375,7 +384,7 @@ if [[ \${URL} != \$(command git config --get remote.origin.url) ]]; then
fi fi
if [[ \${TYPE} == tag ]]; then if [[ \${TYPE} == tag ]]; then
if [[ \${REV} == \$(command git describe --tags --exact-match 2>/dev/null) ]]; then if [[ \${REV} == \$(command git describe --tags --exact-match 2>/dev/null) ]]; then
(( ! QUIET )) && print -PR \${CLEAR_LINE}\"%F{green})%f %B\${MODULE}:%b Already up to date\" (( PRINTLEVEL > 0 )) && print -PR \${CLEAR_LINE}\"%F{green})%f %B\${MODULE}:%b Already up to date\"
return 0 return 0
fi fi
fi fi
@ -404,7 +413,7 @@ else
OUT=\"Updating to \${TYPE} \${REV}\" OUT=\"Updating to \${TYPE} \${REV}\"
fi fi
if ERR=\$(command git submodule update --init --recursive -q 2>&1); then if ERR=\$(command git submodule update --init --recursive -q 2>&1); then
if (( ! QUIET )); then if (( PRINTLEVEL > 0 )); then
[[ -n \${LOG} ]] && OUT=\${OUT}$'\n'\${(F):- \${(f)^LOG}} [[ -n \${LOG} ]] && OUT=\${OUT}$'\n'\${(F):- \${(f)^LOG}}
print -PR \${CLEAR_LINE}\"%F{green})%f %B\${MODULE}:%b \${OUT}\" print -PR \${CLEAR_LINE}\"%F{green})%f %B\${MODULE}:%b \${OUT}\"
fi fi
@ -417,21 +426,30 @@ fi
esac esac
case ${1} in case ${1} in
build) _zimfw_source_zimrc && _zimfw_build && _zimfw_compile ${2} ;; build)
_zimfw_source_zimrc && _zimfw_build || return 1
(( _zprintlevel-- ))
_zimfw_compile
;;
init) _zimfw_source_zimrc && _zimfw_build ;; init) _zimfw_source_zimrc && _zimfw_build ;;
clean) _zimfw_clean_compiled && _zimfw_clean_dumpfile ;; clean) _zimfw_clean_compiled && _zimfw_clean_dumpfile ;;
clean-compiled) _zimfw_clean_compiled ;; clean-compiled) _zimfw_clean_compiled ;;
clean-dumpfile) _zimfw_clean_dumpfile ;; clean-dumpfile) _zimfw_clean_dumpfile ;;
compile) _zimfw_build_login_init && _zimfw_compile ${2} ;; compile) _zimfw_build_login_init && _zimfw_compile ;;
info) _zimfw_info ;; info) _zimfw_info ;;
install|update) install|update)
_zimfw_source_zimrc 1 || return 1 _zimfw_source_zimrc 1 || return 1
print -Rn ${_zmodules_xargs} | xargs -0 -n6 -P10 zsh -c ${ztool} ${1} && \ print -Rn ${_zmodules_xargs} | xargs -0 -n6 -P10 zsh -c ${ztool} ${1} && \
_zimfw_print -PR "Done with ${1}. Restart your terminal for any changes to take effect." && \ _zimfw_print -PR "Done with ${1}. Restart your terminal for any changes to take effect." || return 1
_zimfw_source_zimrc && _zimfw_build && _zimfw_compile ${2} (( _zprintlevel-- ))
_zimfw_source_zimrc && _zimfw_build && _zimfw_compile
;; ;;
uninstall) _zimfw_source_zimrc && _zimfw_uninstall ;; uninstall) _zimfw_source_zimrc && _zimfw_uninstall ;;
upgrade) _zimfw_upgrade && _zimfw_build_login_init && _zimfw_compile ${2} ;; upgrade)
_zimfw_upgrade || return 1
(( _zprintlevel-- ))
_zimfw_build_login_init && _zimfw_compile
;;
*) *)
print -u2 -PR "%F{red}${0}: Unknown action ${1}%f"$'\n'${zusage} print -u2 -PR "%F{red}${0}: Unknown action ${1}%f"$'\n'${zusage}
return 1 return 1