File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -20,9 +20,11 @@ if [ ! -n "$TIPS_FOLDER" ]; then
2020 TIPS_FOLDER=" $prefix /share/cli-tips"
2121fi
2222
23+ SYSTEM_LANGUAGE=" $( echo " $LANG " | cut -d' _' -f1) "
24+
2325# Default language is based on the user's environment
2426if [ ! -n " $TIPS_LANGUAGE " ]; then
25- LANGUAGE=" $( echo " $LANG " | cut -d ' _ ' -f1 ) "
27+ LANGUAGE=" $SYSTEM_LANGUAGE "
2628else
2729 LANGUAGE=" $TIPS_LANGUAGE "
2830fi
@@ -56,6 +58,10 @@ while [[ "$#" -gt 0 ]]; do
5658 case $1 in
5759 -l | --language | --lang)
5860 LANGUAGE=" $2 "
61+ if [[ ! -n " $LANGUAGE " ]]; then
62+ echo " Error: No language specified"
63+ exit 1
64+ fi
5965 shift
6066 ;;
6167 --language=* | --lang=* )
@@ -77,6 +83,11 @@ while [[ "$#" -gt 0 ]]; do
7783 shift
7884done
7985
86+ if [[ ! -n " $LANGUAGE " ]]; then
87+ echo " Error: No language specified"
88+ exit 1
89+ fi
90+
8091# Find the localized tips file
8192if [ -f " $TIPS_FOLDER /${LANGUAGE} .txt" ]; then
8293 localized_file=" $TIPS_FOLDER /${LANGUAGE} .txt"
You can’t perform that action at this time.
0 commit comments