1414# kill -USR1 $$
1515# core.trap_remove 'some_handler' 'USR1'
1616core.trap_add () {
17- core.private.util .init
17+ core._util .init
1818 local function=" $1 "
1919
20- core.private.util .validate_args " $function " $#
20+ core._util .validate_args " $function " $#
2121 local signal_spec=
2222 for signal_spec in " ${@: 2} " ; do
23- core.private.util .validate_signal " $function " " $signal_spec "
23+ core._util .validate_signal " $function " " $signal_spec "
2424
2525 ___global_trap_table___[" $signal_spec " ]=" ${___global_trap_table___[$signal_spec]} " $' \x1C ' " $function "
2626
2727 # rho (WET)
2828 local global_trap_handler_name=
29- printf -v global_trap_handler_name ' %q' " core.private.trap_handler_ ${signal_spec} "
29+ printf -v global_trap_handler_name ' %q' " core._trap_handler_ ${signal_spec} "
3030
3131 if ! eval " $global_trap_handler_name () {
3232 local ___exit_code_original=\$ ?
33- if core.private.util .trap_handler_common '$signal_spec ' \"\$ ___exit_code_original\" ; then
33+ if core._util .trap_handler_common '$signal_spec ' \"\$ ___exit_code_original\" ; then
3434 return \$ ___exit_code_original
3535 else
3636 local ___exit_code_user=\$ ?
@@ -55,13 +55,13 @@ core.trap_add() {
5555# kill -USR1 $$
5656# core.trap_remove 'some_handler' 'USR1'
5757core.trap_remove () {
58- core.private.util .init
58+ core._util .init
5959 local function=" $1 "
6060
61- core.private.util .validate_args " $function " $#
61+ core._util .validate_args " $function " $#
6262 local signal_spec=
6363 for signal_spec in " ${@: 2} " ; do
64- core.private.util .validate_signal " $function " " $signal_spec "
64+ core._util .validate_signal " $function " " $signal_spec "
6565
6666 local -a trap_handlers=()
6767 local new_trap_handlers=
@@ -85,7 +85,7 @@ core.trap_remove() {
8585 if [ -z " $new_trap_handlers " ]; then
8686 # rho (WET)
8787 local global_trap_handler_name=
88- printf -v global_trap_handler_name ' %q' " core.private.trap_handler_ ${signal_spec} "
88+ printf -v global_trap_handler_name ' %q' " core._trap_handler_ ${signal_spec} "
8989 trap -- " $signal_spec "
9090 unset -f " $global_trap_handler_name "
9191 fi
@@ -102,7 +102,7 @@ core.trap_remove() {
102102# [[ 'variable' == @(foxtrot|golf|echo|variable) ]] && printf '%s\n' 'Woof!'
103103# core.shopt_pop
104104core.shopt_push () {
105- core.private.util .init
105+ core._util .init
106106 local shopt_action=" $1 "
107107 local shopt_name=" $2 "
108108
@@ -147,7 +147,7 @@ core.shopt_push() {
147147# [[ 'variable' == @(foxtrot|golf|echo|variable) ]] && printf '%s\n' 'Woof!'
148148# core.shopt_pop
149149core.shopt_pop () {
150- core.private.util .init
150+ core._util .init
151151
152152 if (( ${# ___global_shopt_stack___[@]} == 0 )) ; then
153153 core.panic ' Unable to pop as nothing is in the shopt stack'
@@ -219,7 +219,7 @@ core.panic() {
219219 if [ -n " $2 " ]; then
220220 code=$2
221221 fi
222- if core.private.should_print_color 2; then
222+ if core._should_print_color 2; then
223223 printf " \033[1;31m\033[4m%s:\033[0m %s\n" ' Panic' " $1 " >&2
224224 else
225225 printf " %s: %s\n" ' Panic' " $1 " >&2
@@ -329,7 +329,7 @@ core.print_debug_fn() {
329329core.print_fatal () {
330330 local msg=" $1 "
331331
332- if core.private.should_print_color 2; then
332+ if core._should_print_color 2; then
333333 printf " \033[1;35m%s:\033[0m %s\n" ' Fatal' " $msg " >&2
334334 else
335335 printf " %s: %s\n" ' Fatal' " $msg " >&2
@@ -341,7 +341,7 @@ core.print_fatal() {
341341core.print_error () {
342342 local msg=" $1 "
343343
344- if core.private.should_print_color 2; then
344+ if core._should_print_color 2; then
345345 printf " \033[1;31m%s:\033[0m %s\n" ' Error' " $msg " >&2
346346 else
347347 printf " %s: %s\n" ' Error' " $msg " >&2
@@ -353,7 +353,7 @@ core.print_error() {
353353core.print_warn () {
354354 local msg=" $1 "
355355
356- if core.private.should_print_color 2; then
356+ if core._should_print_color 2; then
357357 printf " \033[1;33m%s:\033[0m %s\n" ' Warn' " $msg " >&2
358358 else
359359 printf " %s: %s\n" ' Warn' " $msg " >&2
@@ -365,7 +365,7 @@ core.print_warn() {
365365core.print_info () {
366366 local msg=" $1 "
367367
368- if core.private.should_print_color 1; then
368+ if core._should_print_color 1; then
369369 printf " \033[1;32m%s:\033[0m %s\n" ' Info' " $msg "
370370 else
371371 printf " %s: %s\n" ' Info' " $msg "
@@ -395,7 +395,7 @@ core.ifs_restore() {
395395# use tput because simple environment variable checking heuristics suffice. Deprecated because this code
396396# has been moved to bash-std
397397core.should_output_color () {
398- if core.private.should_print_color " $@ " ; then : ; else
398+ if core._should_print_color " $@ " ; then : ; else
399399 return $?
400400 fi
401401}
@@ -428,7 +428,7 @@ core.get_package_info() {
428428# this function is called automatically by functions that use global variables
429429# @noargs
430430core.init () {
431- core.private.util .init
431+ core._util .init
432432}
433433
434434# @description (DEPRECATED) Prints stacktrace
0 commit comments