Skip to content

Commit

Permalink
update binaries template using authorizedValues
Browse files Browse the repository at this point in the history
  • Loading branch information
fchastanet committed Sep 15, 2024
1 parent 469c1ca commit 5ef39ae
Show file tree
Hide file tree
Showing 39 changed files with 901 additions and 608 deletions.
7 changes: 4 additions & 3 deletions .pre-commit-config-github.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ repos:
)$
- repo: https://github.com/rhysd/actionlint
rev: v1.6.27
rev: v1.7.1
hooks:
- id: actionlint
stages: [pre-commit, pre-push, manual]

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
args:
Expand Down Expand Up @@ -161,7 +161,7 @@ repos:
exclude: /testsData/

- repo: https://github.com/fchastanet/bash-tools-framework
rev: 5.1.2
rev: 4.0.4
hooks:
- id: fixShebangExecutionBit
- id: awkLint
Expand Down Expand Up @@ -192,6 +192,7 @@ repos:
WARNING,
]
- id: plantuml
args: [--same-dir, -f, png, -f, svg, --limit-size, "1200"]
exclude: |
(?x)(
^conf/mysql2pumlSkins/default.puml$
Expand Down
7 changes: 4 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ repos:
)$
- repo: https://github.com/rhysd/actionlint
rev: v1.6.27
rev: v1.7.1
hooks:
- id: actionlint
stages: [pre-commit, pre-push, manual]

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
args:
Expand Down Expand Up @@ -156,7 +156,7 @@ repos:
exclude: /testsData/

- repo: https://github.com/fchastanet/bash-tools-framework
rev: 5.1.2
rev: 4.0.4
hooks:
- id: fixShebangExecutionBit
- id: awkLint
Expand Down Expand Up @@ -187,6 +187,7 @@ repos:
WARNING,
]
- id: plantuml
args: [--same-dir, -f, png, -f, svg, --limit-size, "1200"]
exclude: |
(?x)(
^conf/mysql2pumlSkins/default.puml$
Expand Down
59 changes: 31 additions & 28 deletions bin/cli
Original file line number Diff line number Diff line change
Expand Up @@ -1824,7 +1824,7 @@ cliCommandParse() {
return 1
fi
if [[ ! "$1" =~ OFF|ERR|ERROR|WARN|WARNING|INFO|DEBUG|TRACE ]]; then
Log::displayError "Command ${SCRIPT_NAME} - Option ${options_parse_arg} - value '$1' is not part of authorized values([OFF ERR ERROR WARN WARNING INFO DEBUG TRACE])"
Log::displayError "Command ${SCRIPT_NAME} - Option ${options_parse_arg} - value '$1' is not part of authorized values(OFF, ERR, ERROR, WARN, WARNING, INFO, DEBUG, TRACE)"
return 1
fi

Expand Down Expand Up @@ -1875,7 +1875,7 @@ cliCommandParse() {
return 1
fi
if [[ ! "$1" =~ OFF|ERR|ERROR|WARN|WARNING|INFO|DEBUG|TRACE ]]; then
Log::displayError "Command ${SCRIPT_NAME} - Option ${options_parse_arg} - value '$1' is not part of authorized values([OFF ERR ERROR WARN WARNING INFO DEBUG TRACE])"
Log::displayError "Command ${SCRIPT_NAME} - Option ${options_parse_arg} - value '$1' is not part of authorized values(OFF, ERR, ERROR, WARN, WARNING, INFO, DEBUG, TRACE)"
return 1
fi

Expand Down Expand Up @@ -1921,7 +1921,7 @@ cliCommandParse() {
return 1
fi
if [[ ! "$1" =~ default|default-force|noColor ]]; then
Log::displayError "Command ${SCRIPT_NAME} - Option ${options_parse_arg} - value '$1' is not part of authorized values([default default-force noColor])"
Log::displayError "Command ${SCRIPT_NAME} - Option ${options_parse_arg} - value '$1' is not part of authorized values(default, default-force, noColor)"
return 1
fi

Expand Down Expand Up @@ -1991,7 +1991,6 @@ cliCommandParse() {

# Argument 1/3 - containerArg
# Argument containerArg min 0 max 1
# Argument containerArg authorizedValues:
elif (( options_parse_parsedArgIndex >= minParsedArgIndex0 &&
options_parse_parsedArgIndex < maxParsedArgIndex1 )); then
if ((options_parse_argParsedCountContainerArg >= 1 )); then
Expand All @@ -2005,7 +2004,6 @@ cliCommandParse() {

# Argument 2/3 - userArg
# Argument userArg min 0 max 1
# Argument userArg authorizedValues:
elif (( options_parse_parsedArgIndex >= minParsedArgIndex1 &&
options_parse_parsedArgIndex < maxParsedArgIndex2 )); then
if ((options_parse_argParsedCountUserArg >= 1 )); then
Expand All @@ -2019,7 +2017,6 @@ cliCommandParse() {

# Argument 3/3 - commandArg
# Argument commandArg min 0 max 1
# Argument commandArg authorizedValues:
elif (( options_parse_parsedArgIndex >= minParsedArgIndex2 &&
options_parse_parsedArgIndex < maxParsedArgIndex3 )); then
if ((options_parse_argParsedCountCommandArg >= 1 )); then
Expand Down Expand Up @@ -2081,18 +2078,18 @@ cliCommandHelp() {
echo
echo -e "${__HELP_TITLE_COLOR}ARGUMENTS:${__RESET_COLOR}"

Array::wrap2 " " 80 2 " [${__HELP_OPTION_COLOR}container${__HELP_NORMAL} {single}]
"
Array::wrap2 " " 80 2 " [${__HELP_OPTION_COLOR}container${__HELP_NORMAL} {single}]"
containerArgHelpFunction

Array::wrap2 " " 80 2 " [${__HELP_OPTION_COLOR}user${__HELP_NORMAL} {single}]
"

Array::wrap2 " " 80 2 " [${__HELP_OPTION_COLOR}user${__HELP_NORMAL} {single}]"
userArgHelpFunction

Array::wrap2 " " 80 2 " [${__HELP_OPTION_COLOR}command${__HELP_NORMAL} {single}]
"

Array::wrap2 " " 80 2 " [${__HELP_OPTION_COLOR}command${__HELP_NORMAL} {single}]"
commandArgHelpFunction


# ------------------------------------------
# options section
# ------------------------------------------
Expand All @@ -2103,69 +2100,77 @@ cliCommandHelp() {
echo



echo -e " ${__HELP_OPTION_COLOR}--config${__HELP_NORMAL} {single}"
Array::wrap2 ' ' 76 4 " " "Displays configuration"
echo



echo -e " ${__HELP_OPTION_COLOR}--bash-framework-config <bash-framework-config>${__HELP_NORMAL} {single}"
Array::wrap2 ' ' 76 4 " " "Use alternate bash framework configuration."
echo



echo -e " ${__HELP_OPTION_COLOR}--verbose${__HELP_NORMAL}, ${__HELP_OPTION_COLOR}-v${__HELP_NORMAL} {single}"
Array::wrap2 ' ' 76 4 " " "Info level verbose mode (alias of --display-level INFO)"
echo



echo -e " ${__HELP_OPTION_COLOR}-vv${__HELP_NORMAL} {single}"
Array::wrap2 ' ' 76 4 " " "Debug level verbose mode (alias of --display-level DEBUG)"
echo



echo -e " ${__HELP_OPTION_COLOR}-vvv${__HELP_NORMAL} {single}"
Array::wrap2 ' ' 76 4 " " "Trace level verbose mode (alias of --display-level TRACE)"
echo



echo -e " ${__HELP_OPTION_COLOR}--log-level <log-level>${__HELP_NORMAL} {single}"
Array::wrap2 ' ' 76 4 " " "Set log level"
echo
Array::wrap2 ' ' 76 6 " Possible values: " "OFF, " "ERR, " "ERROR, " "WARN, " "WARNING, " "INFO, " "DEBUG, " "TRACE"
echo

echo " Possible values: "
echo -e " - ${__OPTION_COLOR}OFF${__RESET_COLOR}"
echo -e " - ${__OPTION_COLOR}ERR${__RESET_COLOR}"
echo -e " - ${__OPTION_COLOR}ERROR${__RESET_COLOR}"
echo -e " - ${__OPTION_COLOR}WARN${__RESET_COLOR}"
echo -e " - ${__OPTION_COLOR}WARNING${__RESET_COLOR}"
echo -e " - ${__OPTION_COLOR}INFO${__RESET_COLOR}"
echo -e " - ${__OPTION_COLOR}DEBUG${__RESET_COLOR}"
echo -e " - ${__OPTION_COLOR}TRACE${__RESET_COLOR}"

echo -e " ${__HELP_OPTION_COLOR}--log-file <log-file>${__HELP_NORMAL} {single}"
Array::wrap2 ' ' 76 4 " " "Set log file"
echo



echo -e " ${__HELP_OPTION_COLOR}--display-level <display-level>${__HELP_NORMAL} {single}"
Array::wrap2 ' ' 76 4 " " "Set display level"
echo
Array::wrap2 ' ' 76 6 " Possible values: " "OFF, " "ERR, " "ERROR, " "WARN, " "WARNING, " "INFO, " "DEBUG, " "TRACE"
echo

echo " Possible values: "
echo -e " - ${__OPTION_COLOR}OFF${__RESET_COLOR}"
echo -e " - ${__OPTION_COLOR}ERR${__RESET_COLOR}"
echo -e " - ${__OPTION_COLOR}ERROR${__RESET_COLOR}"
echo -e " - ${__OPTION_COLOR}WARN${__RESET_COLOR}"
echo -e " - ${__OPTION_COLOR}WARNING${__RESET_COLOR}"
echo -e " - ${__OPTION_COLOR}INFO${__RESET_COLOR}"
echo -e " - ${__OPTION_COLOR}DEBUG${__RESET_COLOR}"
echo -e " - ${__OPTION_COLOR}TRACE${__RESET_COLOR}"

echo -e " ${__HELP_OPTION_COLOR}--no-color${__HELP_NORMAL} {single}"
Array::wrap2 ' ' 76 4 " " "Produce monochrome output. alias of --theme noColor."
echo



echo -e " ${__HELP_OPTION_COLOR}--theme <theme>${__HELP_NORMAL} {single}"
Array::wrap2 ' ' 76 4 " " "Choose color theme - default-force means colors will be produced even if command is piped."
echo
Array::wrap2 ' ' 76 6 " Possible values: " "default, " "default-force, " "noColor"
echo

echo " Possible values: "
echo -e " - ${__OPTION_COLOR}default${__RESET_COLOR}"
echo -e " - ${__OPTION_COLOR}default-force${__RESET_COLOR}"
echo -e " - ${__OPTION_COLOR}noColor${__RESET_COLOR}"
Array::wrap2 ' ' 76 6 " Default value: " "default"
echo

Expand All @@ -2174,12 +2179,10 @@ cliCommandHelp() {
echo



echo -e " ${__HELP_OPTION_COLOR}--quiet${__HELP_NORMAL}, ${__HELP_OPTION_COLOR}-q${__HELP_NORMAL} {single}"
Array::wrap2 ' ' 76 4 " " "Quiet mode, doesn't display any output."
echo


# ------------------------------------------
# longDescription section
# ------------------------------------------
Expand Down
Loading

0 comments on commit 5ef39ae

Please sign in to comment.