Skip to content

Commit

Permalink
refactor: improve consistency and readability of print functions
Browse files Browse the repository at this point in the history
- Refactored the print functions in the core_messages.sh file to improve consistency and readability.
- Updated the output format by adding ellipsis (...) before each status message for better visual separation.
- Replaced hard-coded color codes with variables for easier maintenance.

Co-authored-by: AI Assistant <[email protected]>
  • Loading branch information
dgibbs64 and AI Assistant committed Sep 27, 2023
1 parent 9a70874 commit 6aea401
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions lgsm/modules/core_messages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -372,155 +372,155 @@ fn_prompt_message() {

# YES
fn_print_yes_eol() {
echo -en "${cyan}YES${default}"
echo -en " ... ${cyan}YES${default}"
fn_sleep_time
}

fn_print_yes_eol_nl() {
echo -e "${cyan}YES${default}"
echo -e " ... ${cyan}YES${default}"
fn_sleep_time
}

# NO
fn_print_no_eol() {
echo -en "${red}NO${default}"
echo -en " ... ${red}NO${default}"
fn_sleep_time
}

fn_print_no_eol_nl() {
echo -e "${red}NO${default}"
echo -e " ... ${red}NO${default}"
fn_sleep_time
}

# OK
fn_print_ok_eol() {
echo -en " ${green}OK${default}"
echo -en " ... ${green}OK${default}"
fn_sleep_time
}

fn_print_ok_eol_nl() {
echo -e " ${green}OK${default}"
echo -e " ... ${green}OK${default}"
fn_sleep_time
}

# FAIL
fn_print_fail_eol() {
echo -en " ${red}FAIL${default}"
echo -en " ... ${red}FAIL${default}"
fn_sleep_time
}

fn_print_fail_eol_nl() {
echo -e " ${red}FAIL${default}"
echo -e " ... ${red}FAIL${default}"
fn_sleep_time
}

# ERROR
fn_print_error_eol() {
echo -en " ${red}ERROR${default}"
echo -en " ... ${red}ERROR${default}"
fn_sleep_time
}

fn_print_error_eol_nl() {
echo -e " ${red}ERROR${default}"
echo -e " ... ${red}ERROR${default}"
fn_sleep_time
}

# WAIT
fn_print_wait_eol() {
echo -en " ${cyan}WAIT${default}"
echo -en " ... ${cyan}WAIT${default}"
fn_sleep_time
}

fn_print_wait_eol_nl() {
echo -e " ${cyan}WAIT${default}"
echo -e " ... ${cyan}WAIT${default}"
fn_sleep_time
}

# WARN
fn_print_warn_eol() {
echo -en " ${lightyellow}WARN${default}"
echo -en " ... ${lightyellow}WARN${default}"
fn_sleep_time
}

fn_print_warn_eol_nl() {
echo -e " ${lightyellow}WARN${default}"
echo -e " ... ${lightyellow}WARN${default}"
fn_sleep_time
}

# INFO
fn_print_info_eol() {
echo -en " ${cyan}INFO${default}"
echo -en " ... ${cyan}INFO${default}"
fn_sleep_time
}

fn_print_info_eol_nl() {
echo -e " ${cyan}INFO${default}"
echo -e " ... ${cyan}INFO${default}"
fn_sleep_time
}

# QUERYING
fn_print_querying_eol() {
echo -en " ${cyan}QUERYING${default}"
echo -en " ... ${cyan}QUERYING${default}"
fn_sleep_time
}

fn_print_querying_eol_nl() {
echo -e " ${cyan}QUERYING${default}"
echo -e " ... ${cyan}QUERYING${default}"
fn_sleep_time
}

# CHECKING
fn_print_checking_eol() {
echo -en " ${cyan}CHECKING${default}"
echo -en " ... ${cyan}CHECKING${default}"
fn_sleep_time
}

fn_print_checking_eol_nl() {
echo -e " ${cyan}CHECKING${default}"
echo -e " ... ${cyan}CHECKING${default}"
fn_sleep_time
}

# DELAY
fn_print_delay_eol() {
echo -en " ${green}DELAY${default}"
echo -en " ... ${green}DELAY${default}"
fn_sleep_time
}

fn_print_delay_eol_nl() {
echo -e " ${green}DELAY${default}"
echo -e " ... ${green}DELAY${default}"
fn_sleep_time
}

# CANCELED
fn_print_canceled_eol() {
echo -en " ${lightyellow}CANCELED${default}"
echo -en " ... ${lightyellow}CANCELED${default}"
fn_sleep_time
}

fn_print_canceled_eol_nl() {
echo -e " ${lightyellow}CANCELED${default}"
echo -e " ... ${lightyellow}CANCELED${default}"
fn_sleep_time
}

# REMOVED
fn_print_removed_eol() {
echo -en " ${red}REMOVED${default}"
echo -en " ... ${red}REMOVED${default}"
fn_sleep_time
}

fn_print_removed_eol_nl() {
echo -e " ${red}REMOVED${default}"
echo -e " ... ${red}REMOVED${default}"
fn_sleep_time
}

# UPDATE
fn_print_update_eol() {
echo -en " ${cyan}UPDATE${default}"
echo -en " ... ${cyan}UPDATE${default}"
fn_sleep_time
}

fn_print_update_eol_nl() {
echo -e " ${cyan}UPDATE${default}"
echo -e " ... ${cyan}UPDATE${default}"
fn_sleep_time
}

Expand Down

0 comments on commit 6aea401

Please sign in to comment.