From: Matthias Kruk Date: Thu, 15 Apr 2021 12:05:35 +0000 (+0900) Subject: include/opt: Make --verbose and --shush default arguments X-Git-Url: https://git.corax.cc/?a=commitdiff_plain;h=53caecde2f3adf1a5049c49bc8e5219217187db6;p=toolbox include/opt: Make --verbose and --shush default arguments The -v/--verbose and -w/--shush options are frequently implemented in scripts that use toolbox. To reduce code duplication and to make all scripts follow the same argument naming conventions, this commit makes -v/--verbose and -w/--shush standard arguments of the opt module. --- diff --git a/include/opt.sh b/include/opt.sh index 3c3c9a3..7af5be3 100644 --- a/include/opt.sh +++ b/include/opt.sh @@ -19,6 +19,13 @@ __init() { "Print this text" \ opt_print_help + opt_add_arg "v" "verbose" "no" 0 \ + "Be more verbose" \ + log_increase_verbosity + opt_add_arg "w" "shush" "no" 0 \ + "Be less verbose" \ + log_decrease_verbosity + return 0 }