38
38
# Make sure this is bash that's running and return otherwise.
39
39
# Use POSIX syntax for this line:
40
40
if [ -z " ${BASH_VERSION-} " ]; then
41
- return 1;
41
+ return 1
42
42
fi
43
43
44
44
# We only support Bash 3.1+.
@@ -76,13 +76,13 @@ __bp_install_string=$'__bp_trap_string="$(trap -p DEBUG)"\ntrap - DEBUG\n__bp_in
76
76
# Fails if any of the given variables are readonly
77
77
# Reference https://stackoverflow.com/a/4441178
78
78
__bp_require_not_readonly () {
79
- local var
80
- for var; do
81
- if ! ( unset " $var " 2> /dev/null ); then
82
- echo " bash-preexec requires write access to ${var} " >&2
83
- return 1
84
- fi
85
- done
79
+ local var
80
+ for var; do
81
+ if ! ( unset " $var " 2> /dev/null ); then
82
+ echo " bash-preexec requires write access to ${var} " >&2
83
+ return 1
84
+ fi
85
+ done
86
86
}
87
87
88
88
# Remove ignorespace and or replace ignoreboth from HISTCONTROL
@@ -95,7 +95,7 @@ __bp_adjust_histcontrol() {
95
95
# Replace ignoreboth with ignoredups
96
96
if [[ " $histcontrol " == * " ignoreboth" * ]]; then
97
97
histcontrol=" ignoredups:${histcontrol// ignoreboth} "
98
- fi ;
98
+ fi
99
99
export HISTCONTROL=" $histcontrol "
100
100
}
101
101
@@ -136,7 +136,7 @@ __bp_sanitize_string() {
136
136
# It sets a variable to indicate that the prompt was just displayed,
137
137
# to allow the DEBUG trap to know that the next command is likely interactive.
138
138
__bp_interactive_mode () {
139
- __bp_preexec_interactive_mode=" on" ;
139
+ __bp_preexec_interactive_mode=" on"
140
140
}
141
141
142
142
@@ -154,7 +154,7 @@ __bp_precmd_invoke_cmd() {
154
154
# prompt command" by another precmd execution loop. This avoids infinite
155
155
# recursion.
156
156
if (( __bp_inside_precmd > 0 )) ; then
157
- return
157
+ return
158
158
fi
159
159
local __bp_inside_precmd=1
160
160
@@ -211,7 +211,7 @@ __bp_preexec_invoke_exec() {
211
211
__bp_last_argument_prev_command=" ${1:- } "
212
212
# Don't invoke preexecs if we are inside of another preexec.
213
213
if (( __bp_inside_preexec > 0 )) ; then
214
- return
214
+ return
215
215
fi
216
216
local __bp_inside_preexec=1
217
217
@@ -291,7 +291,7 @@ __bp_preexec_invoke_exec() {
291
291
__bp_install () {
292
292
# Exit if we already have this installed.
293
293
if [[ " ${PROMPT_COMMAND[*]:- } " == * " __bp_precmd_invoke_cmd" * ]]; then
294
- return 1;
294
+ return 1
295
295
fi
296
296
297
297
trap ' __bp_preexec_invoke_exec "$_"' DEBUG
@@ -304,7 +304,7 @@ __bp_install() {
304
304
unset __bp_trap_string
305
305
if [[ -n " $prior_trap " ]]; then
306
306
eval ' __bp_original_debug_trap() {
307
- ' " $prior_trap " '
307
+ ' " $prior_trap " '
308
308
}'
309
309
preexec_functions+=(__bp_original_debug_trap)
310
310
fi
@@ -321,7 +321,7 @@ __bp_install() {
321
321
# Set so debug trap will work be invoked in subshells.
322
322
set -o functrace > /dev/null 2>&1
323
323
shopt -s extdebug > /dev/null 2>&1
324
- fi ;
324
+ fi
325
325
326
326
local existing_prompt_command
327
327
# Remove setting our trap install string and sanitize the existing prompt command string
@@ -369,12 +369,12 @@ __bp_install_after_session_init() {
369
369
if [[ -n " $sanitized_prompt_command " ]]; then
370
370
# shellcheck disable=SC2178 # PROMPT_COMMAND is not an array in bash <= 5.0
371
371
PROMPT_COMMAND=${sanitized_prompt_command} $' \n '
372
- fi ;
372
+ fi
373
373
# shellcheck disable=SC2179 # PROMPT_COMMAND is not an array in bash <= 5.0
374
374
PROMPT_COMMAND+=${__bp_install_string}
375
375
}
376
376
377
377
# Run our install so long as we're not delaying it.
378
378
if [[ -z " ${__bp_delay_install:- } " ]]; then
379
379
__bp_install_after_session_init
380
- fi ;
380
+ fi
0 commit comments