1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2025-07-02 03:59:25 +00:00

Add os-info function and use it in damoekri theme

This commit is contained in:
2018-10-06 20:59:41 +02:00
parent 6c46804f41
commit 53facbe9de
2 changed files with 32 additions and 1 deletions

View File

@ -0,0 +1,23 @@
#
# Exposes information about the OpenStack environment via the $os_info associative
# array.
#
# function os-info {
local tenant
local tenant_format
local tenant_formatted
unset os_info
typeset -gA os_info
[[ -n "${OS_TENANT_NAME+1}" ]] && tenant="[${OS_TENANT_NAME}]"
if [[ "$tenant" != (none|) ]]; then
zstyle -s ':prezto:module:openstack:info:tenant' format 'tenant_format'
zformat -f tenant_formatted "$tenant_format" "s:$tenant"
os_info[tenant]="$tenant_formatted"
fi
# }