Skip to content

Commit

Permalink
Merge branch 'remove-opts-verbose-quiet' of ssh://github.com/TinCanTe…
Browse files Browse the repository at this point in the history
…ch/easy-rsa into TinCanTech-remove-opts-verbose-quiet

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
  • Loading branch information
TinCanTech committed Nov 30, 2022
2 parents 37f9d37 + 195d6e6 commit af73c4c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 24 deletions.
1 change: 0 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Easy-RSA 3 ChangeLog
* Always ensure X509-types files exist (#581 #696)
* Expand alias '--days' to all suitable options with a period (#674)
* Introduce --keep-tmp, keep temp files for debugging (#667)
* Introduce Option -q|--quiet, disable information output (#703)
* Add serialNumber (OID 2.5.4.5) to DN 'org' mode (#606)
* Support ampersand and dollar-sign in vars file (#590)
* Introduce 'rewind-renew' (#579)
Expand Down
31 changes: 8 additions & 23 deletions easyrsa3/easyrsa
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,6 @@ General options:
--batch : Set automatic (no-prompts when possible) mode
--silent|-s : Disable all warnings, notices and information
--sbatch : Combined --silent and --batch operating mode
--quiet|-q : Quiet mode, disable information messages only

--no-pass : Do not use passwords
Can not be used with --passin or --passout
Expand Down Expand Up @@ -548,29 +547,19 @@ $1
# informational notices to stdout
notice() {
[ "$EASYRSA_SILENT" ] && return
[ "$EASYRSA_BATCH" ] && return
print "
Notice
------
$1
"
$1"
} # => notice()

# Helpful information
information() {
[ "$EASYRSA_SILENT" ] && return
[ "$EASYRSA_BATCH" ] && return
[ "$EASYRSA_QUIET" ] && return
print "
* $1"
} # => information()

# Verbose status reports
verbose() {
[ "$EASYRSA_VERBOSE" ] || return 0
print "$1"
} # => verbose()

# intent confirmation helper func
# returns without prompting in EASYRSA_BATCH
confirm() {
Expand Down Expand Up @@ -1074,7 +1063,8 @@ Your newly created PKI dir is:
if [ "$new_vars_true" ]; then
information "\
IMPORTANT: Easy-RSA 'vars' template file has been created in your new PKI.
Edit this 'vars' file to customise the settings for your PKI."
Edit this 'vars' file to customise the settings for your PKI.
To use a global vars file, use global option --vars=<YOUR_VARS>"

elif [ "$user_vars_true" ] || [ "$old_vars_true" ] || [ "$no_new_vars" ]
then
Expand Down Expand Up @@ -3824,7 +3814,8 @@ expire_status() {
# db serial must match certificate serial, otherwise this
# is a renewed cert which has been replaced by an issued cert
if [ "$db_serial" != "$cert_serial" ]; then
verbose "* serial mismatch:
information "\
serial mismatch:
db_serial: $db_serial
cert_serial: $cert_serial
cert_issued: $cert_issued"
Expand Down Expand Up @@ -3904,7 +3895,8 @@ renew_status() {
# db serial must match certificate serial, otherwise this
# is an issued cert that replaces a renewed cert
if [ "$db_serial" != "$cert_serial" ]; then
verbose "* serial mismatch:
information "\
serial mismatch:
db_serial: $db_serial
cert_serial: $cert_serial
cert_file_in: $cert_file_in"
Expand Down Expand Up @@ -4060,8 +4052,8 @@ detect_host() {

# Extra diagnostics
show_host() {
[ "$EASYRSA_SILENT" ] && return
print_version
[ "$EASYRSA_VERBOSE" ] || return 0
print "$host_out"
[ "$EASYRSA_DEBUG" ] || return 0
case "$easyrsa_host_os" in
Expand Down Expand Up @@ -5122,13 +5114,6 @@ while :; do
export EASYRSA_SILENT=1
export EASYRSA_BATCH=1
;;
-q|--quiet)
empty_ok=1
export EASYRSA_QUIET=1 ;;
-v|--verbose)
empty_ok=1
export EASYRSA_VERBOSE=1
;;
--nopass|--no-pass)
empty_ok=1
export EASYRSA_NO_PASS=1
Expand Down

0 comments on commit af73c4c

Please sign in to comment.