summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRay Lee <ray@evq.io>2021-12-23 12:33:26 -0800
committerRay Lee <ray@evq.io>2021-12-23 12:33:26 -0800
commitc275ac34c355ada1a679430c77a44618279dac46 (patch)
tree0242c3c7cbf93bc7c9874c201a87b9ff14b64e4f
parent8c7df50cf244c261a08443142e38c539aebd0f54 (diff)
Simplification, use the ${var:-} null/empty form consistently
-rwxr-xr-xtldr12
1 files changed, 6 insertions, 6 deletions
diff --git a/tldr b/tldr
index 7e1aee3..ee88110 100755
--- a/tldr
+++ b/tldr
@@ -33,7 +33,7 @@ main() {
# Some people like running this without saving any state.
cache true
- if [ "${TLDR_CACHE-}" = no ]; then
+ if [ "${TLDR_CACHE:-}" = no ]; then
cache false
debug log Disabling cache
fi
@@ -176,7 +176,7 @@ cache_dir() {
# page_cache returns the base path for tldr markdown pages.
page_cache() {
- # if [ -z "${page_cache_path-}" ]; then
+ # if [ -z "${page_cache_path:-}" ]; then
# page_cache_path="$(cache_dir)/page-source"
# fi
# echo "$page_cache_path"
@@ -238,7 +238,7 @@ Get() {
# Calling `cache` with no parameters changes the success code to true or false.
cache() {
case $# in
- 0) [ "${cache_bool-}" = true ] ;;
+ 0) [ "${cache_bool:-}" = true ] ;;
1) cache_bool=$1 ;;
esac
}
@@ -285,7 +285,7 @@ platform_order() {
# values to set.
preferred_language() {
case $# in
- 0) echo "${preferred_language_code-}" ;;
+ 0) echo "${preferred_language_code:-}" ;;
*) preferred_language_code="$*" ;;
esac
}
@@ -300,14 +300,14 @@ i18n_paths() {
fi
# if $LANG is unset or empty, English is the fallback.
- if [ -z "${LANG-}" ]; then
+ if [ -z "${LANG:-}" ]; then
debug log i18n: LANGless
echo pages
return
fi
# else the languages are ordered by $LANGUAGE, then $LANG, then English.
- for i in $(split : "${LANGUAGE-}") $LANG; do
+ for i in $(split : "${LANGUAGE:-}") $LANG; do
case $i in
C|POSIX) continue ;;
esac