diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 787b473..c106863 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -79,7 +79,7 @@ jobs: run: gem install bashly -v "${BASHLY_VERSION}" env: # renovate: datasource=github-releases depName=DannyBen/bashly - BASHLY_VERSION: 1.2.2 + BASHLY_VERSION: 1.2.6 - name: 🚀 Run bashly run: bashly generate --upgrade - name: suggester / bashly diff --git a/keencli b/keencli index df08cad..84d20dd 100755 --- a/keencli +++ b/keencli @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# This script was generated by bashly 1.2.2 (https://bashly.dannyb.co) +# This script was generated by bashly 1.2.6 (https://bashly.dannyb.co) # Modifying it manually is not recommended # :wrapper.bash3_bouncer @@ -791,20 +791,29 @@ yellow() { print_in_color "\e[33m" "$*"; } blue() { print_in_color "\e[34m" "$*"; } magenta() { print_in_color "\e[35m" "$*"; } cyan() { print_in_color "\e[36m" "$*"; } +black() { print_in_color "\e[30m" "$*"; } +white() { print_in_color "\e[37m" "$*"; } + bold() { print_in_color "\e[1m" "$*"; } underlined() { print_in_color "\e[4m" "$*"; } + red_bold() { print_in_color "\e[1;31m" "$*"; } green_bold() { print_in_color "\e[1;32m" "$*"; } yellow_bold() { print_in_color "\e[1;33m" "$*"; } blue_bold() { print_in_color "\e[1;34m" "$*"; } magenta_bold() { print_in_color "\e[1;35m" "$*"; } cyan_bold() { print_in_color "\e[1;36m" "$*"; } +black_bold() { print_in_color "\e[1;30m" "$*"; } +white_bold() { print_in_color "\e[1;37m" "$*"; } + red_underlined() { print_in_color "\e[4;31m" "$*"; } green_underlined() { print_in_color "\e[4;32m" "$*"; } yellow_underlined() { print_in_color "\e[4;33m" "$*"; } blue_underlined() { print_in_color "\e[4;34m" "$*"; } magenta_underlined() { print_in_color "\e[4;35m" "$*"; } cyan_underlined() { print_in_color "\e[4;36m" "$*"; } +black_underlined() { print_in_color "\e[4;30m" "$*"; } +white_underlined() { print_in_color "\e[4;37m" "$*"; } # src/lib/functions/calculate_hash.sh function calculate_hash() { @@ -1090,6 +1099,7 @@ validate_json() { # :command.command_functions # :command.function keencli_request_command() { + # src/request_command.sh # shellcheck disable=SC2154 http_command \ @@ -1103,6 +1113,7 @@ keencli_request_command() { # :command.function keencli_show_system_command() { + # src/show_system_command.sh # shellcheck disable=SC2154 url_path="/rci/show/system" @@ -1123,6 +1134,7 @@ keencli_show_system_command() { # :command.function keencli_show_interface_command() { + # src/show_interface_command.sh # shellcheck disable=SC2154 url_path="/rci/show/interface" @@ -1148,6 +1160,7 @@ keencli_show_interface_command() { # :command.function keencli_show_ip_hotspot_list_command() { + # src/show_ip_hotspot_list_command.sh # shellcheck disable=SC2154 url_path="/rci/show/ip/hotspot" @@ -1168,6 +1181,7 @@ keencli_show_ip_hotspot_list_command() { # :command.function keencli_show_ip_hotspot_summary_command() { + # src/show_ip_hotspot_summary_command.sh # shellcheck disable=SC2154 metric_type="${args[--metric_type]}" @@ -1187,6 +1201,7 @@ keencli_show_ip_hotspot_summary_command() { # :command.function keencli_show_internet_command() { + # src/show_internet_command.sh # shellcheck disable=SC2154 url_path="/rci/show/internet/status" @@ -1202,6 +1217,7 @@ keencli_show_internet_command() { # :command.function keencli_show_ntce_summary_command() { + # src/show_ntce_summary_command.sh # shellcheck disable=SC2154 traffic_type="${args[--traffic_type]}" @@ -1222,6 +1238,7 @@ keencli_show_ntce_summary_command() { # :command.function keencli_config_command() { + # src/config_command.sh # shellcheck disable=SC2154 http_command \ @@ -1235,6 +1252,7 @@ keencli_config_command() { # :command.function keencli_log_command() { + # src/log_command.sh # shellcheck disable=SC2154 url_path="/ci/log.txt" @@ -1250,6 +1268,7 @@ keencli_log_command() { # :command.function keencli_self_test_command() { + # src/self_test_command.sh # shellcheck disable=SC2154 url_path="/ci/self-test.txt" @@ -1267,7 +1286,8 @@ keencli_self_test_command() { parse_requirements() { # :command.fixed_flags_filter while [[ $# -gt 0 ]]; do - case "${1:-}" in + key="$1" + case "$key" in --version | -v) version_command exit @@ -1397,7 +1417,8 @@ parse_requirements() { keencli_request_parse_requirements() { # :command.fixed_flags_filter while [[ $# -gt 0 ]]; do - case "${1:-}" in + key="$1" + case "$key" in --help | -h) long_usage=yes keencli_request_usage @@ -1485,7 +1506,6 @@ keencli_request_parse_requirements() { esac done - # :command.required_args_filter if [[ -z ${args['url_path']+x} ]]; then printf "missing required argument: URL_PATH\nusage: keencli request URL_PATH [REQUEST_DATA] [OPTIONS]\n" >&2 @@ -1527,7 +1547,8 @@ keencli_request_parse_requirements() { keencli_show_parse_requirements() { # :command.fixed_flags_filter while [[ $# -gt 0 ]]; do - case "${1:-}" in + key="$1" + case "$key" in --help | -h) long_usage=yes keencli_show_usage @@ -1622,7 +1643,8 @@ keencli_show_parse_requirements() { keencli_show_system_parse_requirements() { # :command.fixed_flags_filter while [[ $# -gt 0 ]]; do - case "${1:-}" in + key="$1" + case "$key" in --help | -h) long_usage=yes keencli_show_system_usage @@ -1740,7 +1762,8 @@ keencli_show_system_parse_requirements() { keencli_show_interface_parse_requirements() { # :command.fixed_flags_filter while [[ $# -gt 0 ]]; do - case "${1:-}" in + key="$1" + case "$key" in --help | -h) long_usage=yes keencli_show_interface_usage @@ -1862,7 +1885,8 @@ keencli_show_interface_parse_requirements() { keencli_show_ip_parse_requirements() { # :command.fixed_flags_filter while [[ $# -gt 0 ]]; do - case "${1:-}" in + key="$1" + case "$key" in --help | -h) long_usage=yes keencli_show_ip_usage @@ -1929,7 +1953,8 @@ keencli_show_ip_parse_requirements() { keencli_show_ip_hotspot_parse_requirements() { # :command.fixed_flags_filter while [[ $# -gt 0 ]]; do - case "${1:-}" in + key="$1" + case "$key" in --help | -h) long_usage=yes keencli_show_ip_hotspot_usage @@ -2003,7 +2028,8 @@ keencli_show_ip_hotspot_parse_requirements() { keencli_show_ip_hotspot_list_parse_requirements() { # :command.fixed_flags_filter while [[ $# -gt 0 ]]; do - case "${1:-}" in + key="$1" + case "$key" in --help | -h) long_usage=yes keencli_show_ip_hotspot_list_usage @@ -2125,7 +2151,8 @@ keencli_show_ip_hotspot_list_parse_requirements() { keencli_show_ip_hotspot_summary_parse_requirements() { # :command.fixed_flags_filter while [[ $# -gt 0 ]]; do - case "${1:-}" in + key="$1" + case "$key" in --help | -h) long_usage=yes keencli_show_ip_hotspot_summary_usage @@ -2286,7 +2313,8 @@ keencli_show_ip_hotspot_summary_parse_requirements() { keencli_show_internet_parse_requirements() { # :command.fixed_flags_filter while [[ $# -gt 0 ]]; do - case "${1:-}" in + key="$1" + case "$key" in --help | -h) long_usage=yes keencli_show_internet_usage @@ -2394,7 +2422,8 @@ keencli_show_internet_parse_requirements() { keencli_show_ntce_parse_requirements() { # :command.fixed_flags_filter while [[ $# -gt 0 ]]; do - case "${1:-}" in + key="$1" + case "$key" in --help | -h) long_usage=yes keencli_show_ntce_usage @@ -2461,7 +2490,8 @@ keencli_show_ntce_parse_requirements() { keencli_show_ntce_summary_parse_requirements() { # :command.fixed_flags_filter while [[ $# -gt 0 ]]; do - case "${1:-}" in + key="$1" + case "$key" in --help | -h) long_usage=yes keencli_show_ntce_summary_usage @@ -2641,7 +2671,8 @@ keencli_show_ntce_summary_parse_requirements() { keencli_config_parse_requirements() { # :command.fixed_flags_filter while [[ $# -gt 0 ]]; do - case "${1:-}" in + key="$1" + case "$key" in --help | -h) long_usage=yes keencli_config_usage @@ -2711,7 +2742,6 @@ keencli_config_parse_requirements() { esac done - # :command.required_args_filter if [[ -z ${args['configuration_file']+x} ]]; then printf "missing required argument: CONFIGURATION_FILE\nusage: keencli config CONFIGURATION_FILE [OPTIONS]\n" >&2 @@ -2747,7 +2777,8 @@ keencli_config_parse_requirements() { keencli_log_parse_requirements() { # :command.fixed_flags_filter while [[ $# -gt 0 ]]; do - case "${1:-}" in + key="$1" + case "$key" in --help | -h) long_usage=yes keencli_log_usage @@ -2834,7 +2865,8 @@ keencli_log_parse_requirements() { keencli_self_test_parse_requirements() { # :command.fixed_flags_filter while [[ $# -gt 0 ]]; do - case "${1:-}" in + key="$1" + case "$key" in --help | -h) long_usage=yes keencli_self_test_usage @@ -2927,11 +2959,11 @@ initialize() { # :command.run run() { - declare -A args=() - declare -A deps=() - declare -a other_args=() - declare -a env_var_names=() - declare -a input=() + declare -g -A args=() + declare -g -A deps=() + declare -g -a other_args=() + declare -g -a env_var_names=() + declare -g -a input=() normalize_input "$@" parse_requirements "${input[@]}" diff --git a/src/lib/colors.sh b/src/lib/colors.sh index cbdc015..7458e2d 100644 --- a/src/lib/colors.sh +++ b/src/lib/colors.sh @@ -26,17 +26,26 @@ yellow() { print_in_color "\e[33m" "$*"; } blue() { print_in_color "\e[34m" "$*"; } magenta() { print_in_color "\e[35m" "$*"; } cyan() { print_in_color "\e[36m" "$*"; } +black() { print_in_color "\e[30m" "$*"; } +white() { print_in_color "\e[37m" "$*"; } + bold() { print_in_color "\e[1m" "$*"; } underlined() { print_in_color "\e[4m" "$*"; } + red_bold() { print_in_color "\e[1;31m" "$*"; } green_bold() { print_in_color "\e[1;32m" "$*"; } yellow_bold() { print_in_color "\e[1;33m" "$*"; } blue_bold() { print_in_color "\e[1;34m" "$*"; } magenta_bold() { print_in_color "\e[1;35m" "$*"; } cyan_bold() { print_in_color "\e[1;36m" "$*"; } +black_bold() { print_in_color "\e[1;30m" "$*"; } +white_bold() { print_in_color "\e[1;37m" "$*"; } + red_underlined() { print_in_color "\e[4;31m" "$*"; } green_underlined() { print_in_color "\e[4;32m" "$*"; } yellow_underlined() { print_in_color "\e[4;33m" "$*"; } blue_underlined() { print_in_color "\e[4;34m" "$*"; } magenta_underlined() { print_in_color "\e[4;35m" "$*"; } cyan_underlined() { print_in_color "\e[4;36m" "$*"; } +black_underlined() { print_in_color "\e[4;30m" "$*"; } +white_underlined() { print_in_color "\e[4;37m" "$*"; }