Skip to content

Commit

Permalink
refact: add global flags
Browse files Browse the repository at this point in the history
  • Loading branch information
serdigital64 committed Aug 1, 2024
1 parent 3d2c3f1 commit 3f8e5f9
Show file tree
Hide file tree
Showing 42 changed files with 42 additions and 106 deletions.
4 changes: 1 addition & 3 deletions docs/skeletons/one-liner/module-task
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,8 @@ function initialize() {
#

declare command='X_COMMAND_X'
declare debug="$BL64_DBG_TARGET_NONE"
declare verbose="$BL64_MSG_VERBOSE_ALL"

bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
2 changes: 1 addition & 1 deletion docs/skeletons/task-generic/module-task
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ while getopts ':xV:D:h' option; do
*) help && exit 1 ;;
esac
done
bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize "$command" || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
4 changes: 1 addition & 3 deletions src/aws-cognito/aws-cognito-password-reset
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,11 @@ function initialize() {
#

declare command='reset'
declare debug="$BL64_DBG_TARGET_NONE"
declare verbose="$BL64_MSG_VERBOSE_ALL"
declare pool_id="${1:-}"
declare username="${2:-}"
declare password="${3:-}"

bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
2 changes: 1 addition & 1 deletion src/aws-eks/aws-eks-ami-show
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ while getopts ':la:r:V:D:h' option; do
*) help && exit 1 ;;
esac
done
bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize "$command" || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
2 changes: 1 addition & 1 deletion src/github-repo/github-repo-show
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ while getopts ':so:r:V:D:h' option; do
*) help && exit 1 ;;
esac
done
bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize "$command" "$owner" "$repository" || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
2 changes: 1 addition & 1 deletion src/k8s/k8s-event-check
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ while getopts ':apjn:V:D:h' option; do
*) help && exit 1 ;;
esac
done
bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize "$command" || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
2 changes: 1 addition & 1 deletion src/k8s/k8s-pod-run
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ while getopts ':si:n:e:V:D:h' option; do
*) help && exit 1 ;;
esac
done
bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize "$command" || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
4 changes: 1 addition & 3 deletions src/linux-dev/linux-dev-block-check
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,9 @@ function initialize() {
#

declare command='check'
declare debug="$BL64_DBG_TARGET_NONE"
declare verbose="$BL64_MSG_VERBOSE_ALL"
declare device_path="${1:-}"

bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
4 changes: 1 addition & 3 deletions src/linux-dev/linux-dev-block-list-path
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ function initialize() {
#

declare command='list'
declare debug="$BL64_DBG_TARGET_NONE"
declare verbose="$BL64_MSG_VERBOSE_ALL"

bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
4 changes: 1 addition & 3 deletions src/linux-dev/linux-dev-block-list-tree
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ function initialize() {
#

declare command='list'
declare debug="$BL64_DBG_TARGET_NONE"
declare verbose="$BL64_MSG_VERBOSE_ALL"

bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
4 changes: 1 addition & 3 deletions src/linux-dev/linux-dev-block-list-uuid
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ function initialize() {
#

declare command='list'
declare debug="$BL64_DBG_TARGET_NONE"
declare verbose="$BL64_MSG_VERBOSE_ALL"

bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
4 changes: 1 addition & 3 deletions src/linux-dev/linux-dev-block-show
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,9 @@ function initialize() {
#

declare command='show'
declare debug="$BL64_DBG_TARGET_NONE"
declare verbose="$BL64_MSG_VERBOSE_ALL"
declare device_path="${1:-}"

bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
4 changes: 1 addition & 3 deletions src/linux-dev/linux-dev-crypt-create
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,10 @@ function initialize() {
#

declare command='show'
declare debug="$BL64_DBG_TARGET_NONE"
declare verbose="$BL64_MSG_VERBOSE_ALL"
declare device_path="${1:-}"
declare volume_label="${2:-}"

bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
4 changes: 1 addition & 3 deletions src/linux-dev/linux-dev-crypt-mount
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,11 @@ function initialize() {
#

declare command='show'
declare debug="$BL64_DBG_TARGET_NONE"
declare verbose="$BL64_MSG_VERBOSE_ALL"
declare device_path="${1:-}"
declare mount_point="${2:-}"
declare volume_name="${3:-}"

bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
4 changes: 1 addition & 3 deletions src/linux-dev/linux-dev-crypt-open
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,10 @@ function initialize() {
#

declare command='open'
declare debug="$BL64_DBG_TARGET_NONE"
declare verbose="$BL64_MSG_VERBOSE_ALL"
declare device_path="${1:-}"
declare volume_name="${2:-}"

bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
4 changes: 1 addition & 3 deletions src/linux-dev/linux-dev-crypt-scan
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,9 @@ function initialize() {
#

declare command='show'
declare debug="$BL64_DBG_TARGET_NONE"
declare verbose="$BL64_MSG_VERBOSE_ALL"
declare device_path="${1:-}"

bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
4 changes: 1 addition & 3 deletions src/linux-dev/linux-dev-crypt-show
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,9 @@ function initialize() {
#

declare command='show'
declare debug="$BL64_DBG_TARGET_NONE"
declare verbose="$BL64_MSG_VERBOSE_ALL"
declare volume_name="${1:-}"

bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
4 changes: 1 addition & 3 deletions src/linux-dev/linux-dev-raid-scan
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,9 @@ function initialize() {
#

declare command='scan'
declare debug="$BL64_DBG_TARGET_NONE"
declare verbose="$BL64_MSG_VERBOSE_ALL"
declare volume_path="${1:-}"

bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
4 changes: 1 addition & 3 deletions src/linux-dev/linux-dev-raid-show
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,9 @@ function initialize() {
#

declare command='show'
declare debug="$BL64_DBG_TARGET_NONE"
declare verbose="$BL64_MSG_VERBOSE_ALL"
declare volume_path="${1:-}"

bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
4 changes: 1 addition & 3 deletions src/linux-dev/linux-dev-raid-start
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ function initialize() {
#

declare command='start'
declare debug="$BL64_DBG_TARGET_NONE"
declare verbose="$BL64_MSG_VERBOSE_ALL"

bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
2 changes: 1 addition & 1 deletion src/linux-distro/linux-distro-upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ while getopts ':pur:V:D:h' option; do
*) help && exit 1 ;;
esac
done
bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize "$command" || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
4 changes: 1 addition & 3 deletions src/linux-fs/linux-fs-check
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,9 @@ function initialize() {
#

declare command='check'
declare debug="$BL64_DBG_TARGET_NONE"
declare verbose="$BL64_MSG_VERBOSE_ALL"
declare device_path="${1:-}"

bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
4 changes: 1 addition & 3 deletions src/linux-fs/linux-fs-create-xfs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,9 @@ function initialize() {
#

declare command='create'
declare debug="$BL64_DBG_TARGET_NONE"
declare verbose="$BL64_MSG_VERBOSE_ALL"
declare device_path="${1:-}"

bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
4 changes: 1 addition & 3 deletions src/linux-kernel/linux-kernel-log-show
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ function initialize() {
#

declare command='show'
declare debug="$BL64_DBG_TARGET_NONE"
declare verbose="$BL64_MSG_VERBOSE_ALL"

bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
4 changes: 1 addition & 3 deletions src/linux-kernel/linux-kernel-log-stream
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ function initialize() {
#

declare command='stream'
declare debug="$BL64_DBG_TARGET_NONE"
declare verbose="$BL64_MSG_VERBOSE_ALL"

bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
4 changes: 1 addition & 3 deletions src/linux-lvm/linux-lvm-lv-list
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,9 @@ function initialize() {
#

declare command='list'
declare debug="$BL64_DBG_TARGET_NONE"
declare verbose="$BL64_MSG_VERBOSE_ALL"
declare fields='lv_name,vg_name,lv_uuid,lv_attr,lv_size,seg_count,segtype,stripes,stripesize,chunksize'

bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
4 changes: 1 addition & 3 deletions src/linux-lvm/linux-lvm-pv-list
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,9 @@ function initialize() {
#

declare command='list'
declare debug="$BL64_DBG_TARGET_NONE"
declare verbose="$BL64_MSG_VERBOSE_ALL"
declare fields='pv_name,vg_name,pv_fmt,pv_uuid,pv_size,dev_size,pv_attr,pv_pe_count,pv_pe_alloc_count'

bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
4 changes: 1 addition & 3 deletions src/linux-lvm/linux-lvm-vg-list
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,9 @@ function initialize() {
#

declare command='list'
declare debug="$BL64_DBG_TARGET_NONE"
declare verbose="$BL64_MSG_VERBOSE_ALL"
declare fields='vg_name,vg_uuid,vg_fmt,vg_attr,vg_extent_size,vg_extent_count,vg_free_count,max_lv,max_pv'

bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
4 changes: 1 addition & 3 deletions src/linux-package/linux-package-cleanup
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,8 @@ function initialize() {
#

declare command='cleanup'
declare debug="$BL64_DBG_TARGET_NONE"
declare verbose="$BL64_MSG_VERBOSE_ALL"

bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
4 changes: 1 addition & 3 deletions src/linux-package/linux-package-upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,8 @@ function initialize() {
#

declare command='upgrade'
declare debug="$BL64_DBG_TARGET_NONE"
declare verbose="$BL64_MSG_VERBOSE_ALL"

bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
2 changes: 1 addition & 1 deletion src/pgsql/pgsql-index-info
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ while getopts ':leko:p:u:b:x:V:D:h' option; do
*) help && exit 1 ;;
esac
done
bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize "$command" "$index" || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
2 changes: 1 addition & 1 deletion src/pgsql/pgsql-query-info
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ while getopts ':ao:p:u:b:V:D:h' option; do
*) help && exit 1 ;;
esac
done
bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize "$command" || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
2 changes: 1 addition & 1 deletion src/pgsql/pgsql-server-lab-control
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ while getopts ':soV:D:h' option; do
*) help && exit 1 ;;
esac
done
bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize "$command" || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
2 changes: 1 addition & 1 deletion src/pgsql/pgsql-table-info
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ while getopts ':leo:p:u:b:t:V:D:h' option; do
*) help && exit 1 ;;
esac
done
bl64_dbg_set_level "$debug" && bl64_msg_set_level "$verbose" || exit $?
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $?
initialize "$command" "$table" || exit $?

bl64_msg_show_batch_start "$command"
Expand Down
Loading

0 comments on commit 3f8e5f9

Please sign in to comment.