lib/shopt: Add support for CASE_SENSITIVE

Co-authored-by: Koichi Murase <myoga.murase@gmail.com>
This commit is contained in:
saul365
2020-10-08 08:05:27 +00:00
committed by Koichi Murase
parent 1288ba3c06
commit 4c7bd86a5e
+8 -1
View File
@@ -27,7 +27,14 @@ shopt -s nocaseglob;
## SMARTER TAB-COMPLETION (Readline bindings) ##
# Perform file completion in a case insensitive fashion
bind "set completion-ignore-case on"
if [[ ${CASE_SENSITIVE-} == false ]]; then
bind "set completion-ignore-case on"
elif [[ ${CASE_SENSITIVE-} == true ]]; then
bind "set completion-ignore-case off"
else
# By default, case sensitivity is disabled.
bind "set completion-ignore-case on"
fi
# Treat hyphens and underscores as equivalent
bind "set completion-map-case on"