Skip to content

Commit c3f7131

Browse files
committed
Move version warnings away from top of file
1 parent b946b8c commit c3f7131

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

mk-cert

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,11 @@ if [ ! -n "$BASH_VERSION" ];then exec bash "$0" "$@";else set +o posix;fi
44
eval 'f() { local i=$((3+(6)));[[ $i = "$(cat <(echo 9))" ]];};f' \
55
2>/dev/null || { echo >&2 "This version of bash is too old";exit 1;}
66

7-
set -e
8-
PROGRAM="$0"
7+
set -e ; PROGRAM="$0"
98

109
show_help_text() {
11-
1210
echo "Usage: $(basename "$PROGRAM") [Common Name] [arguments]"
13-
14-
[[ "$BASH3" = yes || "$NOMIXING" = yes || "$BASHREGEX" = no ]] && {
15-
echo ""
16-
echo "BEWARE: Some features are broken or work poorly on this version"
17-
echo "of bash: $BASH_VERSION"
18-
}
19-
20-
[[ "$NOPKEY" = yes || "$NOECPARAM" = yes ]] && {
21-
echo ""
22-
echo "BEWARE: Some features are broken or work poorly on this version"
23-
echo "of openssl: $(openssl version)"
24-
}
11+
version_warnings
2512

2613
cat <<\!
2714
@@ -323,6 +310,23 @@ Version 3 certificate extensions.
323310
exit 0
324311
}
325312

313+
version_warnings() {
314+
315+
[[ "$BASH3" = yes || "$NOMIXING" = yes || "$BASHREGEX" = no ]] && {
316+
echo ""
317+
echo "BEWARE: Some features are broken or work poorly on this version"
318+
echo "of bash: $BASH_VERSION"
319+
}
320+
321+
[[ "$NOPKEY" = yes || "$NOECPARAM" = yes ]] && {
322+
echo ""
323+
echo "BEWARE: Some features are broken or work poorly on this version"
324+
echo "of openssl: $(openssl version)"
325+
}
326+
327+
return 0
328+
}
329+
326330
main() {
327331
eval "typeset -A SANDUP # bash4/ksh" 2>/dev/null && BASH3=no || BASH3=yes
328332

0 commit comments

Comments
 (0)