From 8be5750ccc032ca05311b551b4494764df0a5765 Mon Sep 17 00:00:00 2001 From: romkatv Date: Fri, 7 Feb 2020 11:38:18 +0100 Subject: [PATCH 1/4] add POWERLEVEL9K_ASDF_${plugin}_{SOURCES,PROMPT_ALWAYS_SHOW} with fallback to POWERLEVEL9K_ASDF_{SOURCES,PROMPT_ALWAYS_SHOW} --- internal/p10k.zsh | 171 +++++++++++++++++++++++++++++----------------- 1 file changed, 109 insertions(+), 62 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 273096b4..c26cb4d5 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4577,6 +4577,7 @@ function _p9k_asdf_init_meta() { fi local name for name in $($list_names 2>/dev/null); do + [[ $name == (*/*|*:*|.tool-versions) ]] && continue _p9k_asdf_file_info[$name]+="${plugin:t} $has_parse " done fi @@ -4602,71 +4603,32 @@ function _p9k_asdf_init_meta() { } } -function prompt_asdf() { - _p9k_asdf_check_meta || _p9k_asdf_init_meta || return - - local -A versions - local plugin - for plugin in $_p9k_asdf_plugins; do - local var=ASDF_${(U)plugin//-/_}_VERSION - local val="${(P)var}" - [[ -n $val ]] && versions[$plugin]=$val - done - +# Usage: _p9k_asdf_parse_version_file +# +# Mutates `versions` on success. +function _p9k_asdf_parse_version_file() { + local file=$1 + local is_legacy=$2 local -a stat - zstat -A stat +mtime ~ 2>/dev/null || return - local dirs=($_p9k__parent_dirs ~) - local mtimes=($_p9k__parent_mtimes $stat[1]) - - local elem - for elem in ${(@)${:-{1..$#dirs}}/(#m)*/${${:-$MATCH:$_p9k__asdf_dir2files[$dirs[MATCH]]}#$MATCH:$mtimes[MATCH]:}}; do - if [[ $elem == *:* ]]; then - local dir=$dirs[${elem%%:*}] - zstat -A stat +mtime $dir 2>/dev/null || return - local files=($dir/.tool-versions(N) $dir/${(k)^_p9k_asdf_file_info}(N)) - _p9k__asdf_dir2files[$dir]=$stat[1]:${(pj:\0:)files} - else - local files=(${(0)elem}) - fi - local file - for file in $files; do - zstat -A stat +mtime $file 2>/dev/null || return - local cached=$_p9k_asdf_file2versions[$file] + zstat -A stat +mtime $file 2>/dev/null || return + if (( is_legacy )); then + local plugin has_parse + for plugin has_parse in $=_p9k_asdf_file_info[$file:t]; do + (( $+versions[$plugin] )) && continue + local cached=$_p9k_asdf_file2versions[$file:$plugin] if [[ $cached == $stat[1]:* ]]; then - local file_versions=(${(0)${cached#*:}}) + versions[$plugin]=${cached#*:} else - local file_versions=() - if [[ $file == */.tool-versions ]]; then - { local lines=(${(@)${(f)"$(<$file)"}/\#*}) } 2>/dev/null - local line - for line in $lines; do - local words=($=line) - (( $#words > 1 && $_p9k_asdf_plugins[(Ie)$words[1]] )) || continue - file_versions+=($words[1] "${words[2,-1]}") - done + if (( has_parse )); then + local v=($(${ASDF_DATA_DIR:-~/.asdf}/plugins/$plugin/bin/parse-legacy-file $file 2>/dev/null)) else - local plugin has_parse - for plugin has_parse in $=_p9k_asdf_file_info[$file:t]; do - if (( has_parse )); then - local v=($(${ASDF_DATA_DIR:-~/.asdf}/plugins/$plugin/bin/parse-legacy-file $file 2>/dev/null)) - else - { local v=($(<$file)) } 2>/dev/null - fi - (( $#v )) && file_versions+=($plugin "$v") - done + { local v=($(<$file)) } 2>/dev/null fi - _p9k_asdf_file2versions[$file]=$stat[1]:${(pj:\0:)file_versions} + (( $#v )) && versions[$plugin]="$v" + _p9k_asdf_file2versions[$file:$plugin]=$stat[1]:"$v" fi - local plugin version - for plugin version in $file_versions; do - [[ -z $versions[$plugin] ]] && versions[$plugin]=$version - done done - done - - if [[ -r $ASDF_DEFAULT_TOOL_VERSIONS_FILENAME ]]; then - local file=$ASDF_DEFAULT_TOOL_VERSIONS_FILENAME - zstat -A stat +mtime $file 2>/dev/null || return + else local cached=$_p9k_asdf_file2versions[$file] if [[ $cached == $stat[1]:* ]]; then local file_versions=(${(0)${cached#*:}}) @@ -4683,13 +4645,98 @@ function prompt_asdf() { fi local plugin version for plugin version in $file_versions; do - [[ -z $versions[$plugin] ]] && versions[$plugin]=$version + (( $+versions[$plugin] )) || versions[$plugin]=$version done fi + return 0 +} - local plugin version - for plugin version in ${(kv)versions}; do +function prompt_asdf() { + _p9k_asdf_check_meta || _p9k_asdf_init_meta || return + + local -A versions + local -a stat + zstat -A stat +mtime ~ 2>/dev/null || return + local dirs=($_p9k__parent_dirs ~) + local mtimes=($_p9k__parent_mtimes $stat[1]) + local -i has_global + + local elem + for elem in ${(@)${:-{1..$#dirs}}/(#m)*/${${:-$MATCH:$_p9k__asdf_dir2files[$dirs[MATCH]]}#$MATCH:$mtimes[MATCH]:}}; do + if [[ $elem == *:* ]]; then + local dir=$dirs[${elem%%:*}] + zstat -A stat +mtime $dir 2>/dev/null || return + local files=($dir/.tool-versions(N) $dir/${(k)^_p9k_asdf_file_info}(N)) + _p9k__asdf_dir2files[$dir]=$stat[1]:${(pj:\0:)files} + else + local files=(${(0)elem}) + fi + if [[ ${files[1]:h} == ~ ]]; then + has_global=1 + local -A local_versions=(${(kv)versions}) + versions=() + fi + local file + for file in $files; do + [[ $file == */.tool-versions ]] + _p9k_asdf_parse_version_file $file $? || return + done + done + + if (( ! has_global )); then + has_global=1 + local -A local_versions=(${(kv)versions}) + versions=() + fi + + if [[ -r $ASDF_DEFAULT_TOOL_VERSIONS_FILENAME ]]; then + _p9k_asdf_parse_version_file $ASDF_DEFAULT_TOOL_VERSIONS_FILENAME 0 || return + fi + + local plugin + for plugin in $_p9k_asdf_plugins; do local upper=${(U)plugin//-/_} + local var=POWERLEVEL9K_ASDF_${upper}_SOURCES + if (( $+parameters[$var] )); then + local sources=(${(P)var}) + else + var=POWERLEVEL9K_ASDF_SOURCES + if (( $+parameters[$var] )); then + local sources=(${(P)var}) + else + local sources=(shell local global) + fi + fi + + var=ASDF_${upper}_VERSION + local version="${(P)var}" + if [[ -n $version ]]; then + (( $sources[(I)shell] )) || continue + else + version=$local_versions[$plugin] + if [[ -n $version ]]; then + (( $sources[(I)local] )) || continue + else + version=$versions[$plugin] + [[ -n $version ]] || continue + (( $sources[(I)global] )) || continue + fi + fi + + if [[ $version == $versions[$plugin] ]]; then + var=POWERLEVEL9K_ASDF_${upper}_PROMPT_ALWAYS_SHOW + if (( $+parameters[$var] )); then + [[ ${(P)var} == true ]] || continue + else + var=POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW + if (( $+parameters[$var] )); then + [[ ${(P)var} == true ]] || continue + else + continue + fi + fi + fi + _p9k_get_icon $0_$upper ${upper}_ICON $plugin _p9k_prompt_segment $0_$upper green $_p9k_color1 $'\1'$_p9k_ret 0 '' ${version//\%/%%} done @@ -6868,7 +6915,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v38\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v39\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$DEFAULT_USER\1${ZLE_RPROMPT_INDENT:-1}\1$P9K_SSH\1$__p9k_ksh_arrays' From 59f8d186b6be74d43fc5820f063afb27ca2b806c Mon Sep 17 00:00:00 2001 From: romkatv Date: Fri, 7 Feb 2020 11:46:08 +0100 Subject: [PATCH 2/4] add POWERLEVEL9K_ASDF_${plugin}_SHOW_SYSTEM with fallback to POWERLEVEL9K_ASDF_SHOW_SYSTEM --- internal/p10k.zsh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index c26cb4d5..c6682288 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4737,6 +4737,18 @@ function prompt_asdf() { fi fi + if [[ $version == system ]]; then + var=POWERLEVEL9K_ASDF_${upper}_SHOW_SYSTEM + if (( $+parameters[$var] )); then + [[ ${(P)var} == true ]] || continue + else + var=POWERLEVEL9K_ASDF_SHOW_SYSTEM + if (( $+parameters[$var] )); then + [[ ${(P)var} == true ]] || continue + fi + fi + fi + _p9k_get_icon $0_$upper ${upper}_ICON $plugin _p9k_prompt_segment $0_$upper green $_p9k_color1 $'\1'$_p9k_ret 0 '' ${version//\%/%%} done From a0f4447b60ad2330824ffe0decc443863befda41 Mon Sep 17 00:00:00 2001 From: romkatv Date: Fri, 7 Feb 2020 12:12:38 +0100 Subject: [PATCH 3/4] add hide-related asdf parameters to config templates --- config/p10k-classic.zsh | 39 ++++++++++++++++++++++++++++++++++++ config/p10k-lean-8colors.zsh | 39 ++++++++++++++++++++++++++++++++++++ config/p10k-lean.zsh | 39 ++++++++++++++++++++++++++++++++++++ config/p10k-rainbow.zsh | 39 ++++++++++++++++++++++++++++++++++++ 4 files changed, 156 insertions(+) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 0627305a..3dae4f3d 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -528,6 +528,45 @@ # Default asdf color. Only used to display tools for which there is no color override (see below). typeset -g POWERLEVEL9K_ASDF_FOREGROUND=66 + # There are three parameters that can be used to hide tools. If at least one of them decides + # to hide a tool, that tool gets hidden. POWERLEVEL9K_ASDF_SHOW_SYSTEM=false hides "system". To + # see the difference between POWERLEVEL9K_ASDF_SOURCES and POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW + # consider the effect of the following commands: + # + # asdf local python 3.8.1 + # asdf global python 3.8.1 + # + # After running both commands the current python version is 3.8.1 and its source is "local" as + # it takes precedence over "global". If POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW is set to false, + # it'll hide python version in this case because 3.8.1 is the same as the global version. + # POWERLEVEL9K_ASDF_SOURCES will hide python version only if the value of this parameter doesn't + # contain "local". + + # Hide tool versions that don't come from one of these sources. + # + # Available sources: + # + # - shell `asdf current` says "set by ASDF_${TOOL}_VERSION environment variable" + # - local `asdf current` says "set by /some/not/home/directory/file" + # - global `asdf current` says "set by /home/username/file" + # + # Note: If this parameter is set to (shell local global), it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SOURCES. + typeset -g POWERLEVEL9K_ASDF_SOURCES=(shell local global) + + # If set to false, hide tool versions that are the same as global. + # + # Note: The name of this parameter doesn't reflect its meaning at all. + # Note: If this parameter is set to true, it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_PROMPT_ALWAYS_SHOW. + typeset -g POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW=false + + # If set to false, hide tool versions that are equal to "system". + # + # Note: If this parameter is set to true, it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_SYSTEM. + typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true + # Ruby version from asdf. typeset -g POWERLEVEL9K_ASDF_RUBY_FOREGROUND=168 # typeset -g POWERLEVEL9K_ASDF_RUBY_VISUAL_IDENTIFIER_EXPANSION='⭐' diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 5c7590d9..8fd3b4f0 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -529,6 +529,45 @@ # Default asdf color. Only used to display tools for which there is no color override (see below). typeset -g POWERLEVEL9K_ASDF_FOREGROUND=6 + # There are three parameters that can be used to hide tools. If at least one of them decides + # to hide a tool, that tool gets hidden. POWERLEVEL9K_ASDF_SHOW_SYSTEM=false hides "system". To + # see the difference between POWERLEVEL9K_ASDF_SOURCES and POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW + # consider the effect of the following commands: + # + # asdf local python 3.8.1 + # asdf global python 3.8.1 + # + # After running both commands the current python version is 3.8.1 and its source is "local" as + # it takes precedence over "global". If POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW is set to false, + # it'll hide python version in this case because 3.8.1 is the same as the global version. + # POWERLEVEL9K_ASDF_SOURCES will hide python version only if the value of this parameter doesn't + # contain "local". + + # Hide tool versions that don't come from one of these sources. + # + # Available sources: + # + # - shell `asdf current` says "set by ASDF_${TOOL}_VERSION environment variable" + # - local `asdf current` says "set by /some/not/home/directory/file" + # - global `asdf current` says "set by /home/username/file" + # + # Note: If this parameter is set to (shell local global), it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SOURCES. + typeset -g POWERLEVEL9K_ASDF_SOURCES=(shell local global) + + # If set to false, hide tool versions that are the same as global. + # + # Note: The name of this parameter doesn't reflect its meaning at all. + # Note: If this parameter is set to true, it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_PROMPT_ALWAYS_SHOW. + typeset -g POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW=false + + # If set to false, hide tool versions that are equal to "system". + # + # Note: If this parameter is set to true, it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_SYSTEM. + typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true + # Ruby version from asdf. typeset -g POWERLEVEL9K_ASDF_RUBY_FOREGROUND=1 # typeset -g POWERLEVEL9K_ASDF_RUBY_VISUAL_IDENTIFIER_EXPANSION='⭐' diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index bde8b784..d331a120 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -529,6 +529,45 @@ # Default asdf color. Only used to display tools for which there is no color override (see below). typeset -g POWERLEVEL9K_ASDF_FOREGROUND=66 + # There are three parameters that can be used to hide tools. If at least one of them decides + # to hide a tool, that tool gets hidden. POWERLEVEL9K_ASDF_SHOW_SYSTEM=false hides "system". To + # see the difference between POWERLEVEL9K_ASDF_SOURCES and POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW + # consider the effect of the following commands: + # + # asdf local python 3.8.1 + # asdf global python 3.8.1 + # + # After running both commands the current python version is 3.8.1 and its source is "local" as + # it takes precedence over "global". If POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW is set to false, + # it'll hide python version in this case because 3.8.1 is the same as the global version. + # POWERLEVEL9K_ASDF_SOURCES will hide python version only if the value of this parameter doesn't + # contain "local". + + # Hide tool versions that don't come from one of these sources. + # + # Available sources: + # + # - shell `asdf current` says "set by ASDF_${TOOL}_VERSION environment variable" + # - local `asdf current` says "set by /some/not/home/directory/file" + # - global `asdf current` says "set by /home/username/file" + # + # Note: If this parameter is set to (shell local global), it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SOURCES. + typeset -g POWERLEVEL9K_ASDF_SOURCES=(shell local global) + + # If set to false, hide tool versions that are the same as global. + # + # Note: The name of this parameter doesn't reflect its meaning at all. + # Note: If this parameter is set to true, it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_PROMPT_ALWAYS_SHOW. + typeset -g POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW=false + + # If set to false, hide tool versions that are equal to "system". + # + # Note: If this parameter is set to true, it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_SYSTEM. + typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true + # Ruby version from asdf. typeset -g POWERLEVEL9K_ASDF_RUBY_FOREGROUND=168 # typeset -g POWERLEVEL9K_ASDF_RUBY_VISUAL_IDENTIFIER_EXPANSION='⭐' diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 12fcea6e..7eccde74 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -531,6 +531,45 @@ typeset -g POWERLEVEL9K_ASDF_FOREGROUND=0 typeset -g POWERLEVEL9K_ASDF_BACKGROUND=7 + # There are three parameters that can be used to hide tools. If at least one of them decides + # to hide a tool, that tool gets hidden. POWERLEVEL9K_ASDF_SHOW_SYSTEM=false hides "system". To + # see the difference between POWERLEVEL9K_ASDF_SOURCES and POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW + # consider the effect of the following commands: + # + # asdf local python 3.8.1 + # asdf global python 3.8.1 + # + # After running both commands the current python version is 3.8.1 and its source is "local" as + # it takes precedence over "global". If POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW is set to false, + # it'll hide python version in this case because 3.8.1 is the same as the global version. + # POWERLEVEL9K_ASDF_SOURCES will hide python version only if the value of this parameter doesn't + # contain "local". + + # Hide tool versions that don't come from one of these sources. + # + # Available sources: + # + # - shell `asdf current` says "set by ASDF_${TOOL}_VERSION environment variable" + # - local `asdf current` says "set by /some/not/home/directory/file" + # - global `asdf current` says "set by /home/username/file" + # + # Note: If this parameter is set to (shell local global), it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SOURCES. + typeset -g POWERLEVEL9K_ASDF_SOURCES=(shell local global) + + # If set to false, hide tool versions that are the same as global. + # + # Note: The name of this parameter doesn't reflect its meaning at all. + # Note: If this parameter is set to true, it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_PROMPT_ALWAYS_SHOW. + typeset -g POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW=false + + # If set to false, hide tool versions that are equal to "system". + # + # Note: If this parameter is set to true, it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_SYSTEM. + typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true + # Ruby version from asdf. typeset -g POWERLEVEL9K_ASDF_RUBY_FOREGROUND=0 typeset -g POWERLEVEL9K_ASDF_RUBY_BACKGROUND=1 From 6a79008aec9833c53ff0d8118c636f27368a1fff Mon Sep 17 00:00:00 2001 From: romkatv Date: Fri, 7 Feb 2020 12:18:38 +0100 Subject: [PATCH 4/4] notes --- internal/notes.txt | 47 +--------------------------------------------- 1 file changed, 1 insertion(+), 46 deletions(-) diff --git a/internal/notes.txt b/internal/notes.txt index 37b59191..6f265c82 100644 --- a/internal/notes.txt +++ b/internal/notes.txt @@ -8,49 +8,4 @@ disabling implicit reset on every eval in _p9k_worker_receive. - implement fake gitstatus api on top of vcs_info (or plain git?) + worker and use it if there is no gitstatus. - -## asdf - -- https://asdf-vm.com/#/core-configuration?id=environment-variables -- https://asdf-vm.com/#/core-configuration?id=tool-versions -- https://asdf-vm.com/#/core-configuration?id=homeasdfrc -- https://asdf-vm.com/#/plugins-create?id=binlist-legacy-filenames -- https://asdf-vm.com/#/plugins-create?id=binparse-legacy-file -- `print -lr -- ${ASDF_DATA_DIR:-~/.asdf}/plugins/*(/N:t)` -- `print -lr -- $(${ASDF_DATA_DIR:-~/.asdf}/plugins/ruby/bin/list-legacy-filenames)` -- `${ASDF_DATA_DIR:-~/.asdf}/plugins/ruby/bin/parse-legacy-file ~/powerlevel10k/test/foo/.ruby-version` - - if empty, keep looking -- ASDF_${upcase_name}_VERSION wins over everything -- deeper version overrides win -- .tool-versions wins over .ruby-version when in the same directory -- versions for different tools are looked up independently: if /foo/bar/.tool-versions doesn't - override "ruby" it's as if it doesn't exist as far as ruby version is concerned. -- after upglob look $HOME (same file patterns) -- finally look at $ASDF_DEFAULT_TOOL_VERSIONS_FILENAME (single file; parse it like .tool-versions) -- ${ASDF_CONFIG_FILE:-~/.asdfrc} parsing: - opt="$( - grep -E "^\\s*legacy_version_file\\s*=\\s*" "$config_path" | - head | - awk -F '=' '{print $2}' | - sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" - [[ $opt == yes ]] - -Stat caches: -- ${ASDF_CONFIG_FILE:-~/.asdfrc} => legacy_version_file (yes or no) -- ${ASDF_DATA_DIR:-~/.asdf}/plugins => list of plugins -- ${ASDF_DATA_DIR:-~/.asdf}/plugins/ruby/bin => list of relevant scripts - (list-legacy-filenames and parse-legacy-file) -- ${ASDF_DATA_DIR:-~/.asdf}/plugins/ruby/bin/list-legacy-filenames => list (or pattern made from it?) -- /foo/bar => { tool => version } (permanent cache via stat cache) - ---- - -typeset -ga _p9k_asdf_meta_files=( - ${ASDF_CONFIG_FILE:-~/.asdfrc} - ${ASDF_DATA_DIR:-~/.asdf}/plugins - ${ASDF_DATA_DIR:-~/.asdf}/plugins/*/bin{,/list-legacy-filenames,/parse-legacy-file}(N) -) -typeset -g _p9k_asdf_meta_sig # $ASDF_CONFIG_FILE ':' $ASDF_DATA_DIR ':' $ASDF_DEFAULT_TOOL_VERSIONS_FILENAME ':' $ASDF_DEFAULT_TOOL_VERSIONS_FILENAME ':' ${(j.:.)mtimes} - -typeset -g _p9k_asdf_file_pat # example: '(.tool-versions|.ruby-version)' -typeset -gA _p9k_asdf_file_info # .ruby-version => ruby1 ('1' means parse-legacy-file is present) +- add _SHOW_SYSTEM to all *env segments.