From f51b548e9e23f03928f6db8476234ccacae652ce Mon Sep 17 00:00:00 2001 From: Eric Nielsen <4120606+ericbn@users.noreply.github.com> Date: Wed, 27 Nov 2024 18:58:49 -0500 Subject: [PATCH] Also list not installed modules with list action when not in verbose mode. Still fail in this case in verbose mode because zmodule needs to eagerly inspect the module files. --- CHANGELOG.md | 4 +++- src/stage2/69_zimfw_run_list.zsh.erb | 1 + src/stage2/80_zimfw.zsh.erb | 5 +++-- zimfw.zsh | 8 +++++--- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0287810..eae68a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -_No unreleased changes._ +### Added + +- Also list not installed modules with `list` action, when not in verbose mode. ## [1.16.0] - 2024-11-25 diff --git a/src/stage2/69_zimfw_run_list.zsh.erb b/src/stage2/69_zimfw_run_list.zsh.erb index c7ae55c..605182f 100644 --- a/src/stage2/69_zimfw_run_list.zsh.erb +++ b/src/stage2/69_zimfw_run_list.zsh.erb @@ -2,6 +2,7 @@ _zimfw_run_list() { local -r zname=${1} local -r zdir=${_zdirs[${zname}]} print -nR "${_zbold}${zname}:${_znormal} ${zdir}" + if [[ ! -e ${zdir} ]] print -n ' (not installed)' if [[ -z ${_zurls[${zname}]} ]] print -n ' (external)' if (( ${_zfrozens[${zname}]} )) print -n ' (frozen)' if (( ${_zdisabled_root_dirs[(I)${zdir}]} )) print -n ' (disabled)' diff --git a/src/stage2/80_zimfw.zsh.erb b/src/stage2/80_zimfw.zsh.erb index 8bf7ee9..dca683d 100644 --- a/src/stage2/80_zimfw.zsh.erb +++ b/src/stage2/80_zimfw.zsh.erb @@ -84,8 +84,9 @@ Options: help) print -R ${zusage} ;; info) _zimfw_info ;; list) - _zimfw_source_zimrc 1 && zargs -n 1 -- "${_znames[@]}" -- _zimfw_run_list && \ - _zimfw_list_unuseds ' (unused)' + _zimfw_source_zimrc $(( _zprintlevel > 1 )) && \ + zargs -n 1 -- "${_znames[@]}" -- _zimfw_run_list && \ + _zimfw_list_unuseds ' (unused)' ;; check) _zrestartmsg= diff --git a/zimfw.zsh b/zimfw.zsh index 2d5d2d3..182fe68 100644 --- a/zimfw.zsh +++ b/zimfw.zsh @@ -468,7 +468,7 @@ _zimfw_info() { _zimfw_info_print_symlink ZIM_HOME ${ZIM_HOME} _zimfw_info_print_symlink 'zimfw config' ${_zconfig} _zimfw_info_print_symlink 'zimfw script' ${__ZIMFW_FILE} - print -R 'zimfw version: '${_zversion}' (built at 2024-11-27 23:41:51 UTC, previous commit is 923014a)' + print -R 'zimfw version: '${_zversion}' (built at 2024-11-27 23:56:10 UTC, previous commit is e9279aa)' local zparam for zparam in LANG ${(Mk)parameters:#LC_*} OSTYPE TERM TERM_PROGRAM TERM_PROGRAM_VERSION ZSH_VERSION; do print -R ${(r.22....:.)zparam}${(P)zparam} @@ -532,6 +532,7 @@ _zimfw_run_list() { local -r zname=${1} local -r zdir=${_zdirs[${zname}]} print -nR "${_zbold}${zname}:${_znormal} ${zdir}" + if [[ ! -e ${zdir} ]] print -n ' (not installed)' if [[ -z ${_zurls[${zname}]} ]] print -n ' (external)' if (( ${_zfrozens[${zname}]} )) print -n ' (frozen)' if (( ${_zdisabled_root_dirs[(I)${zdir}]} )) print -n ' (disabled)' @@ -1041,8 +1042,9 @@ Options: help) print -R ${zusage} ;; info) _zimfw_info ;; list) - _zimfw_source_zimrc 1 && zargs -n 1 -- "${_znames[@]}" -- _zimfw_run_list && \ - _zimfw_list_unuseds ' (unused)' + _zimfw_source_zimrc $(( _zprintlevel > 1 )) && \ + zargs -n 1 -- "${_znames[@]}" -- _zimfw_run_list && \ + _zimfw_list_unuseds ' (unused)' ;; check) _zrestartmsg=