Skip to content
This repository was archived by the owner on May 20, 2024. It is now read-only.

Commit 518ab89

Browse files
CodingMarkusCodingMarkus
CodingMarkus
authored and
CodingMarkus
committed
Replace "" with '' where possible
1 parent 297d0b2 commit 518ab89

13 files changed

+79
-57
lines changed

lib/psst/basic.inc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ esac
77
INCLUDE_SEEN_PSST="${INCLUDE_SEEN_PSST-}:basic:"
88

99
# Ensure INCLUDE_PSST is set
10-
[ -n "${INCLUDE_PSST-}" ] || { echo "INCLUDE_PSST not set!" >&2 ; exit 1 ; }
10+
[ -n "${INCLUDE_PSST-}" ] || { echo 'INCLUDE_PSST not set!' >&2 ; exit 1 ; }
1111

1212

1313
# shellcheck source=basic/assert.inc.sh

lib/psst/basic/chkcmd.inc.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ esac
77
INCLUDE_SEEN_PSST="${INCLUDE_SEEN_PSST-}:chkcmd:"
88

99
# Ensure INCLUDE_PSST is set
10-
[ -n "${INCLUDE_PSST-}" ] || { echo "INCLUDE_PSST not set!" >&2 ; exit 1 ; }
10+
[ -n "${INCLUDE_PSST-}" ] || { echo 'INCLUDE_PSST not set!' >&2 ; exit 1 ; }
1111

1212

1313
# shellcheck source=assert.inc.sh
@@ -37,9 +37,9 @@ INCLUDE_SEEN_PSST="${INCLUDE_SEEN_PSST-}:chkcmd:"
3737
#
3838
chkcmd_psst()
3939
(
40-
func="chkcmd_psst"
40+
func='chkcmd_psst'
4141
assert_minargc_psst "$func" 1 $#
42-
assert_hasarg_psst "$func" "cmd" "$1"
42+
assert_hasarg_psst "$func" 'cmd' "$1"
4343

4444
while [ -n "${1-}" ]; do
4545
if ! command -v "$1" >/dev/null; then

lib/psst/basic/conv.inc.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ esac
77
INCLUDE_SEEN_PSST="${INCLUDE_SEEN_PSST-}:conv:"
88

99
# Ensure INCLUDE_PSST is set
10-
[ -n "${INCLUDE_PSST-}" ] || { echo "INCLUDE_PSST not set!" >&2 ; exit 1 ; }
10+
[ -n "${INCLUDE_PSST-}" ] || { echo 'INCLUDE_PSST not set!' >&2 ; exit 1 ; }
1111

1212

1313
# shellcheck source=test.inc.sh
@@ -51,9 +51,9 @@ INCLUDE_SEEN_PSST="${INCLUDE_SEEN_PSST-}:conv:"
5151
#
5252
conv_chr_psst()
5353
(
54-
func="chr_psst"
54+
func='chr_psst'
5555
assert_minargc_psst "$func" 1 $#
56-
assert_hasarg_psst "$func" "charCode" "$1"
56+
assert_hasarg_psst "$func" 'charCode' "$1"
5757

5858
for char in "$@"
5959
do
@@ -95,9 +95,9 @@ conv_chr_psst()
9595
#
9696
conv_ord_psst()
9797
(
98-
func="ord_psst"
98+
func='ord_psst'
9999
assert_argc_psst "$func" 1 $#
100-
assert_hasarg_psst "$func" "chars" "$1"
100+
assert_hasarg_psst "$func" 'chars' "$1"
101101

102102
chars=$1
103103
[ ${#chars} -eq 1 ] && { LC_CTYPE=C printf "%d" "'$chars"; return 0; }

lib/psst/basic/esc.inc.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ esac
77
INCLUDE_SEEN_PSST="${INCLUDE_SEEN_PSST-}:esc:"
88

99
# Ensure INCLUDE_PSST is set
10-
[ -n "${INCLUDE_PSST-}" ] || { echo "INCLUDE_PSST not set!" >&2 ; exit 1 ; }
10+
[ -n "${INCLUDE_PSST-}" ] || { echo 'INCLUDE_PSST not set!' >&2 ; exit 1 ; }
1111

1212

1313
# shellcheck source=assert.inc.sh
@@ -36,7 +36,7 @@ INCLUDE_SEEN_PSST="${INCLUDE_SEEN_PSST-}:esc:"
3636
#
3737
esc_for_sq_psst()
3838
(
39-
func="esc_for_sq_psst"
39+
func='esc_for_sq_psst'
4040
assert_argc_psst "$func" 1 $#
4141

4242
value=$1

lib/psst/basic/list.inc.sh

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ esac
77
INCLUDE_SEEN_PSST="${INCLUDE_SEEN_PSST-}:list:"
88

99
# Ensure INCLUDE_PSST is set
10-
[ -n "${INCLUDE_PSST-}" ] || { echo "INCLUDE_PSST not set!" >&2 ; exit 1 ; }
10+
[ -n "${INCLUDE_PSST-}" ] || { echo 'INCLUDE_PSST not set!' >&2 ; exit 1 ; }
1111

1212

1313
# shellcheck source=assert.inc.sh
@@ -46,7 +46,7 @@ INCLUDE_SEEN_PSST="${INCLUDE_SEEN_PSST-}:list:"
4646
#
4747
list_append_psst()
4848
(
49-
func="list_append_psst"
49+
func='list_append_psst'
5050
assert_minargc_psst "$func" 2 $#
5151

5252
list=$1
@@ -55,19 +55,19 @@ list_append_psst()
5555

5656
[ ${#del} -eq 1 ] \
5757
|| assert_func_fail_psst "$func" \
58-
"List delimiter must be single character"
58+
'List delimiter must be single character'
5959

6060
! [ "$del" = "$NL_CHAR_PSST" ] \
6161
|| assert_func_fail_psst "$func" \
62-
"List delimiter must not be newline"
62+
'List delimiter must not be newline'
6363

6464
case $list in
6565
'' | *"$del") ;;
6666
*) assert_func_fail_psst "$func" \
67-
"Argument \"list\" is not a valid list"
67+
'Argument "list" is not a valid list'
6868
esac
6969

70-
printf "%s%s%s" "$list" "$newValue" "$del"
70+
printf '%s%s%s' "$list" "$newValue" "$del"
7171
)
7272

7373

@@ -100,7 +100,7 @@ list_append_psst()
100100
#
101101
list_prepend_psst()
102102
(
103-
func="list_prepend_psst"
103+
func='list_prepend_psst'
104104
assert_minargc_psst "$func" 2 $#
105105

106106
list=$1
@@ -109,19 +109,19 @@ list_prepend_psst()
109109

110110
[ ${#del} -eq 1 ] \
111111
|| assert_func_fail_psst "$func" \
112-
"List delimiter must be single character"
112+
'List delimiter must be single character'
113113

114114
! [ "$del" = "$NL_CHAR_PSST" ] \
115115
|| assert_func_fail_psst "$func" \
116-
"List delimiter must not be newline"
116+
'List delimiter must not be newline'
117117

118118
case $list in
119119
'' | *"$del") ;;
120120
*) assert_func_fail_psst "$func" \
121-
"Argument \"list\" is not a valid list"
121+
'Argument "list" is not a valid list'
122122
esac
123123

124-
printf "%s%s%s" "$newValue" "$del" "$list"
124+
printf '%s%s%s' "$newValue" "$del" "$list"
125125
)
126126

127127

@@ -156,26 +156,26 @@ list_append_list_psst()
156156

157157
[ ${#del} -eq 1 ] \
158158
|| assert_func_fail_psst "$func" \
159-
"List delimiter must be single character"
159+
'List delimiter must be single character'
160160

161161
! [ "$del" = "$NL_CHAR_PSST" ] \
162162
|| assert_func_fail_psst "$func" \
163-
"List delimiter must not be newline"
163+
'List delimiter must not be newline'
164164

165165
case $list1 in
166166
'' | *"$del") ;;
167167
*) assert_func_fail_psst "$func" \
168-
"Argument \"list1\" is not a valid list"
168+
'Argument "list1" is not a valid list'
169169
esac
170170

171171
case $list2 in
172172
'' | *"$del") ;;
173173
*) assert_func_fail_psst "$func" \
174-
"Argument \"list2\" is not a valid list"
174+
'Argument "list2" is not a valid list'
175175
esac
176176

177177

178-
printf "%s%s" "$list1" "$list2"
178+
printf '%s%s' "$list1" "$list2"
179179
)
180180

181181

@@ -202,7 +202,7 @@ list_append_list_psst()
202202

203203
list_prepend_list_psst()
204204
(
205-
func="list_prepend_list_psst"
205+
func='list_prepend_list_psst'
206206
assert_minargc_psst "$func" 2 $#
207207

208208
list1=$1
@@ -211,24 +211,24 @@ list_prepend_list_psst()
211211

212212
[ ${#del} -eq 1 ] \
213213
|| assert_func_fail_psst "$func" \
214-
"List delimiter must be single character"
214+
'List delimiter must be single character'
215215

216216
! [ "$del" = "$NL_CHAR_PSST" ] \
217217
|| assert_func_fail_psst "$func" \
218-
"List delimiter must not be newline"
218+
'List delimiter must not be newline'
219219

220220
case $list1 in
221221
'' | *"$del") ;;
222222
*) assert_func_fail_psst "$func" \
223-
"Argument \"list1\" is not a valid list"
223+
'Argument "list1" is not a valid list'
224224
esac
225225

226226
case $list2 in
227227
'' | *"$del") ;;
228228
*) assert_func_fail_psst "$func" \
229-
"Argument \"list2\" is not a valid list"
229+
'Argument "list2" is not a valid list'
230230
esac
231231

232232

233-
printf "%s%s" "$list2" "$list1"
233+
printf '%s%s' "$list2" "$list1"
234234
)

lib/psst/basic/perror.inc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ esac
77
INCLUDE_SEEN_PSST="${INCLUDE_SEEN_PSST-}:perror:"
88

99
# Ensure INCLUDE_PSST is set
10-
[ -n "${INCLUDE_PSST-}" ] || { echo "INCLUDE_PSST not set!" >&2 ; exit 1 ; }
10+
[ -n "${INCLUDE_PSST-}" ] || { echo 'INCLUDE_PSST not set!' >&2 ; exit 1 ; }
1111

1212

1313
# shellcheck source=print.inc.sh

lib/psst/basic/print.inc.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ esac
77
INCLUDE_SEEN_PSST="${INCLUDE_SEEN_PSST-}:print:"
88

99
# Ensure INCLUDE_PSST is set
10-
[ -n "${INCLUDE_PSST-}" ] || { echo "INCLUDE_PSST not set!" >&2 ; exit 1 ; }
10+
[ -n "${INCLUDE_PSST-}" ] || { echo 'INCLUDE_PSST not set!' >&2 ; exit 1 ; }
1111

1212

13+
# shellcheck source=assert.inc.sh
14+
. "$INCLUDE_PSST/basic/assert.inc.sh"
15+
1316
# shellcheck source=global.inc.sh
1417
. "$INCLUDE_PSST/basic/global.inc.sh"
1518

@@ -41,7 +44,7 @@ print_psst()
4144
IFS=
4245
string="$*"
4346

44-
lines=$( printf "%s\n" "$string" \
47+
lines=$( printf '%s\n' "$string" \
4548
| fold -w "$TERM_WIDTH_PSST" -s \
4649
| sed "s/ $//"
4750
)
@@ -71,9 +74,9 @@ print_psst()
7174
#
7275
print_i_psst()
7376
(
74-
func="print_i_psst"
77+
func='print_i_psst'
7578
assert_minargc_psst "$func" 1 $#
76-
assert_hasarg_psst "$func" "indent" "$1"
79+
assert_hasarg_psst "$func" 'indent' "$1"
7780

7881
indent="$1"
7982
shift
@@ -82,7 +85,7 @@ print_i_psst()
8285
string="$*"
8386

8487
cols=$(( TERM_WIDTH_PSST - indent ))
85-
lines=$( printf "%s\n" "$string" \
88+
lines=$( printf '%s\n' "$string" \
8689
| fold -w "$cols" -s \
8790
| sed "s/ $//"
8891
)
@@ -91,6 +94,6 @@ print_i_psst()
9194
for line in $lines
9295
do
9396
line=${line% }
94-
printf "%*s%s\n" "$indent" '' "$line"
97+
printf '%*s%s\n' "$indent" '' "$line"
9598
done
9699
)

lib/psst/basic/proc.inc.sh

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,24 @@ proc_start_psst()
6262
# process handles on exit and therefor we require an at-exit handler in
6363
# this shell.
6464

65-
assert_minargc_psst "proc_start_psst" 3 $#
66-
assert_hasarg_psst "proc_start_psst" "resultVarName" "$1"
67-
assert_hasarg_psst "proc_start_psst" "mode" "$2"
68-
assert_hasarg_psst "proc_start_psst" "cmd" "$3"
65+
assert_minargc_psst 'proc_start_psst' 3 $#
66+
assert_hasarg_psst 'proc_start_psst' 'resultVarName' "$1"
67+
assert_hasarg_psst 'proc_start_psst' 'mode' "$2"
68+
assert_hasarg_psst 'proc_start_psst' 'cmd' "$3"
6969

7070
# resultVarName=$1
7171
# mode=$4
7272
# cmd=$3
7373

7474
# shellcheck disable=SC2016
75-
[ ${#2} -eq 3 ] || assert_fail_psst '`mode` must be 3 characters long'
75+
[ ${#2} -eq 3 ] || assert_func_fail_psst 'proc_start_psst' \
76+
'`mode` must be 3 characters long'
77+
7678
case $2 in
7779
*[!.ox]*)
7880
# shellcheck disable=SC2016
79-
assert_fail_psst '`mode` may only contain ".", "o", and "x"'
81+
assert_func_fail_psst 'proc_start_psst' \
82+
'"mode" may only contain ".", "o", and "x"'
8083
esac
8184

8285
chkcmd_psst "$3" || return 1
@@ -175,9 +178,9 @@ proc_start_psst()
175178
#
176179
proc_get_pid_psst()
177180
(
178-
func="proc_get_pid_psst"
181+
func='proc_get_pid_psst'
179182
assert_argc_psst "$func" 1 $#
180-
assert_hasarg_psst "$func" "procHandle" "$1"
183+
assert_hasarg_psst "$func" 'procHandle' "$1"
181184

182185
procHandle=$1
183186

@@ -208,9 +211,9 @@ proc_get_pid_psst()
208211
#
209212
proc_is_alive_psst()
210213
(
211-
func="proc_get_pid_psst"
214+
func='proc_get_pid_psst'
212215
assert_argc_psst "$func" 1 $#
213-
assert_hasarg_psst "$func" "procHandle" "$1"
216+
assert_hasarg_psst "$func" 'procHandle' "$1"
214217

215218
procHandle=$1
216219

@@ -252,9 +255,9 @@ proc_stop_psst()
252255

253256
# procHandle=$1
254257

255-
func="proc_get_pid_psst"
258+
func='proc_get_pid_psst'
256259
assert_argc_psst "$func" 1 $#
257-
assert_hasarg_psst "$func" "procHandle" "$1"
260+
assert_hasarg_psst "$func" 'procHandle' "$1"
258261

259262
_pidFile_proc_psst="$1/pid"
260263
[ -f "$_pidFile_proc_psst" ] \

lib/psst/basic/tmpdir.inc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ esac
77
INCLUDE_SEEN_PSST="${INCLUDE_SEEN_PSST-}:tempdir:"
88

99
# Ensure INCLUDE_PSST is set
10-
[ -n "${INCLUDE_PSST-}" ] || { echo "INCLUDE_PSST not set!" >&2 ; exit 1 ; }
10+
[ -n "${INCLUDE_PSST-}" ] || { echo 'INCLUDE_PSST not set!' >&2 ; exit 1 ; }
1111

1212

1313
# shellcheck source=../basic/onexit.inc.sh

lib/psst/file.inc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ esac
77
INCLUDE_SEEN_PSST="${INCLUDE_SEEN_PSST-}:file:"
88

99
# Ensure INCLUDE_PSST is set
10-
[ -n "${INCLUDE_PSST-}" ] || { echo "INCLUDE_PSST not set!" >&2 ; exit 1 ; }
10+
[ -n "${INCLUDE_PSST-}" ] || { echo 'INCLUDE_PSST not set!' >&2 ; exit 1 ; }
1111

1212

1313

lib/psst/file/abspath.inc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ esac
77
INCLUDE_SEEN_PSST="${INCLUDE_SEEN_PSST-}:abspath:"
88

99
# Ensure INCLUDE_PSST is set
10-
[ -n "${INCLUDE_PSST-}" ] || { echo "INCLUDE_PSST not set!" >&2 ; exit 1 ; }
10+
[ -n "${INCLUDE_PSST-}" ] || { echo 'INCLUDE_PSST not set!' >&2 ; exit 1 ; }
1111

1212

1313
# shellcheck source=../basic/assert.inc.sh

lib/psst/file/glob.inc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ esac
77
INCLUDE_SEEN_PSST="${INCLUDE_SEEN_PSST-}:glob:"
88

99
# Ensure INCLUDE_PSST is set
10-
[ -n "${INCLUDE_PSST-}" ] || { echo "INCLUDE_PSST not set!" >&2 ; exit 1 ; }
10+
[ -n "${INCLUDE_PSST-}" ] || { echo 'INCLUDE_PSST not set!' >&2 ; exit 1 ; }
1111

1212

1313
# shellcheck source=../basic/assert.inc.sh

0 commit comments

Comments
 (0)