Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/awkLint
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,7 @@ Result in checkstyle format.")"
# shellcheck disable=SC2054
helpArray=(choose\ color\ theme\ -\ default-force\ means\ colors\ will\ be\ produced\ even\ if\ command\ is\ piped)
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: default'
echo " Default value: default"
echo ' Possible values: default|default-force|noColor'
echo -e " ${__HELP_OPTION_COLOR}--help${__HELP_NORMAL}, ${__HELP_OPTION_COLOR}-h${__HELP_NORMAL} {single}"
local -a helpArray
Expand Down
2 changes: 1 addition & 1 deletion bin/buildBinFiles
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,7 @@ INTERNAL TOOL")"
# shellcheck disable=SC2054
helpArray=(choose\ color\ theme\ -\ default-force\ means\ colors\ will\ be\ produced\ even\ if\ command\ is\ piped)
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: default'
echo " Default value: default"
echo ' Possible values: default|default-force|noColor'
echo -e " ${__HELP_OPTION_COLOR}--help${__HELP_NORMAL}, ${__HELP_OPTION_COLOR}-h${__HELP_NORMAL} {single}"
local -a helpArray
Expand Down
8 changes: 4 additions & 4 deletions bin/buildPushDockerImage
Original file line number Diff line number Diff line change
Expand Up @@ -1396,21 +1396,21 @@ INTERNAL
# shellcheck disable=SC2054
helpArray=(vendor\ image\ to\ use:\ alpine\|ubuntu)
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: ubuntu'
echo " Default value: ubuntu"
echo ' Possible values: alpine|ubuntu'
echo -e " ${__HELP_OPTION_COLOR}--bash-version <String>${__HELP_NORMAL} {single}"
local -a helpArray
# shellcheck disable=SC2054
helpArray=(version\ of\ bash\ to\ use:\ 4.4\|5.0\|5.1\|5.2)
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: 5.1'
echo " Default value: 5.1"
echo ' Possible values: 4.4|5.0|5.1|5.2'
echo -e " ${__HELP_OPTION_COLOR}--bash-base-image <String>${__HELP_NORMAL} {single}"
local -a helpArray
# shellcheck disable=SC2054
helpArray=(bash\ bash\ image\ to\ use\ \(eg:\ ubuntu:20.04\,\ amd64/bash:4.4-alpine3.18\))
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: ubuntu:20.04'
echo " Default value: ubuntu:20.04"
echo -e " ${__HELP_OPTION_COLOR}--branch-name <String>${__HELP_NORMAL} {single}"
local -a helpArray
# shellcheck disable=SC2054
Expand Down Expand Up @@ -1463,7 +1463,7 @@ INTERNAL
# shellcheck disable=SC2054
helpArray=(choose\ color\ theme\ -\ default-force\ means\ colors\ will\ be\ produced\ even\ if\ command\ is\ piped)
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: default'
echo " Default value: default"
echo ' Possible values: default|default-force|noColor'
echo -e " ${__HELP_OPTION_COLOR}--help${__HELP_NORMAL}, ${__HELP_OPTION_COLOR}-h${__HELP_NORMAL} {single}"
local -a helpArray
Expand Down
14 changes: 7 additions & 7 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,17 @@ declare -agx _COMPILE_FILE_ARGUMENTS=()

# read command parameters
# $@ is all command line parameters passed to the script.
# -o is for short options like -h
# -l is for long options with double dash like --help
# the comma separates different long options
# -o is for short compileOptions like -h
# -l is for long compileOptions with double dash like --help
# the comma separates different long compileOptions
longOpts="help,src-dir:,template-dir:,bin-dir:,root-dir:,src-path:,bin-file:,keep-temp-files,verbose,vv,vvv"
shortOpts="hks:t:b:r:f:v"
options=$(getopt -l "${longOpts}" -o "${shortOpts}" -a -- "${BASH_FRAMEWORK_ARGV[@]}" 2>/dev/null) || {
compileOptions=$(getopt -l "${longOpts}" -o "${shortOpts}" -a -- "${BASH_FRAMEWORK_ARGV[@]}" 2>/dev/null) || {
showHelp
Log::fatal "invalid options specified"
Log::fatal "invalid compileOptions specified"
}

eval set -- "${options}"
eval set -- "${compileOptions}"
while true; do
case $1 in
-h | --help)
Expand Down Expand Up @@ -251,7 +251,7 @@ done
# add framework src dir by default
srcDirs+=("${_COMPILE_SRC_DIR}")
_COMPILE_FILE_ARGUMENTS+=(-s "${_COMPILE_SRC_DIR}")
# add temporary generated functions src dir(Options)
# add temporary generated functions src dir(compileOptions)
mkdir -p "${TMPDIR}/src" || true
srcDirs+=("${TMPDIR}/src")
_COMPILE_FILE_ARGUMENTS+=(-s "${TMPDIR}/src")
Expand Down
4 changes: 2 additions & 2 deletions bin/definitionLint
Original file line number Diff line number Diff line change
Expand Up @@ -1457,7 +1457,7 @@ definitionLintCommand() {
# shellcheck disable=SC2054
helpArray=(define\ output\ format\ of\ this\ command)
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: plain'
echo " Default value: plain"
echo ' Possible values: plain|checkstyle'
echo
echo -e "${__HELP_TITLE_COLOR}GLOBAL OPTIONS:${__RESET_COLOR}"
Expand Down Expand Up @@ -1501,7 +1501,7 @@ definitionLintCommand() {
# shellcheck disable=SC2054
helpArray=(choose\ color\ theme\ -\ default-force\ means\ colors\ will\ be\ produced\ even\ if\ command\ is\ piped)
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: default'
echo " Default value: default"
echo ' Possible values: default|default-force|noColor'
echo -e " ${__HELP_OPTION_COLOR}--help${__HELP_NORMAL}, ${__HELP_OPTION_COLOR}-h${__HELP_NORMAL} {single}"
local -a helpArray
Expand Down
8 changes: 4 additions & 4 deletions bin/doc
Original file line number Diff line number Diff line change
Expand Up @@ -1933,21 +1933,21 @@ docCommand() {
# shellcheck disable=SC2054
helpArray=(vendor\ image\ to\ use:\ alpine\|ubuntu)
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: ubuntu'
echo " Default value: ubuntu"
echo ' Possible values: alpine|ubuntu'
echo -e " ${__HELP_OPTION_COLOR}--bash-version <String>${__HELP_NORMAL} {single}"
local -a helpArray
# shellcheck disable=SC2054
helpArray=(version\ of\ bash\ to\ use:\ 4.4\|5.0\|5.1\|5.2)
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: 5.1'
echo " Default value: 5.1"
echo ' Possible values: 4.4|5.0|5.1|5.2'
echo -e " ${__HELP_OPTION_COLOR}--bash-base-image <String>${__HELP_NORMAL} {single}"
local -a helpArray
# shellcheck disable=SC2054
helpArray=(bash\ bash\ image\ to\ use\ \(eg:\ ubuntu:20.04\,\ amd64/bash:4.4-alpine3.18\))
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: ubuntu:20.04'
echo " Default value: ubuntu:20.04"
echo -e " ${__HELP_OPTION_COLOR}--branch-name <String>${__HELP_NORMAL} {single}"
local -a helpArray
# shellcheck disable=SC2054
Expand Down Expand Up @@ -2005,7 +2005,7 @@ docCommand() {
# shellcheck disable=SC2054
helpArray=(choose\ color\ theme\ -\ default-force\ means\ colors\ will\ be\ produced\ even\ if\ command\ is\ piped)
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: default'
echo " Default value: default"
echo ' Possible values: default|default-force|noColor'
echo -e " ${__HELP_OPTION_COLOR}--help${__HELP_NORMAL}, ${__HELP_OPTION_COLOR}-h${__HELP_NORMAL} {single}"
local -a helpArray
Expand Down
2 changes: 1 addition & 1 deletion bin/dockerLint
Original file line number Diff line number Diff line change
Expand Up @@ -1562,7 +1562,7 @@ dockerLintCommand() {
# shellcheck disable=SC2054
helpArray=(choose\ color\ theme\ -\ default-force\ means\ colors\ will\ be\ produced\ even\ if\ command\ is\ piped)
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: default'
echo " Default value: default"
echo ' Possible values: default|default-force|noColor'
echo -e " ${__HELP_OPTION_COLOR}--help${__HELP_NORMAL}, ${__HELP_OPTION_COLOR}-h${__HELP_NORMAL} {single}"
local -a helpArray
Expand Down
2 changes: 1 addition & 1 deletion bin/findShebangFiles
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,7 @@ findShebangFiles() {
# shellcheck disable=SC2054
helpArray=(choose\ color\ theme\ -\ default-force\ means\ colors\ will\ be\ produced\ even\ if\ command\ is\ piped)
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: default'
echo " Default value: default"
echo ' Possible values: default|default-force|noColor'
echo -e " ${__HELP_OPTION_COLOR}--help${__HELP_NORMAL}, ${__HELP_OPTION_COLOR}-h${__HELP_NORMAL} {single}"
local -a helpArray
Expand Down
4 changes: 2 additions & 2 deletions bin/frameworkLint
Original file line number Diff line number Diff line change
Expand Up @@ -1379,7 +1379,7 @@ frameworkLintCommand() {
# shellcheck disable=SC2054
helpArray=(define\ output\ format\ of\ this\ command)
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: plain'
echo " Default value: plain"
echo ' Possible values: plain|checkstyle'
echo -e " ${__HELP_OPTION_COLOR}--expected-warnings-count <String>${__HELP_NORMAL} {single}"
local -a helpArray
Expand Down Expand Up @@ -1428,7 +1428,7 @@ frameworkLintCommand() {
# shellcheck disable=SC2054
helpArray=(choose\ color\ theme\ -\ default-force\ means\ colors\ will\ be\ produced\ even\ if\ command\ is\ piped)
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: default'
echo " Default value: default"
echo ' Possible values: default|default-force|noColor'
echo -e " ${__HELP_OPTION_COLOR}--help${__HELP_NORMAL}, ${__HELP_OPTION_COLOR}-h${__HELP_NORMAL} {single}"
local -a helpArray
Expand Down
8 changes: 4 additions & 4 deletions bin/megalinter
Original file line number Diff line number Diff line change
Expand Up @@ -1497,7 +1497,7 @@ megalinterCommand() {
# shellcheck disable=SC2054
helpArray=(define\ output\ format\ of\ this\ command)
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: plain'
echo " Default value: plain"
echo ' Possible values: plain|json'
echo -e " ${__HELP_OPTION_COLOR}--fix${__HELP_NORMAL} {single}"
local -a helpArray
Expand All @@ -1519,7 +1519,7 @@ megalinterCommand() {
# shellcheck disable=SC2054
helpArray=(Specify\ docker\ megalinter\ image\ name\ to\ use)
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: oxsecurity/megalinter-terraform:v7.4.0'
echo " Default value: oxsecurity/megalinter-terraform:v7.4.0"
echo -e " ${__HELP_OPTION_COLOR}--check-megalinter-version${__HELP_NORMAL} {single}"
local -a helpArray
# shellcheck disable=SC2054
Expand All @@ -1530,7 +1530,7 @@ megalinterCommand() {
# shellcheck disable=SC2054
helpArray=(Specify\ megalinter\ config\ filename\ to\ use)
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: .mega-linter.yml'
echo " Default value: .mega-linter.yml"
echo
echo -e "${__HELP_TITLE_COLOR}GLOBAL OPTIONS:${__RESET_COLOR}"
echo -e " ${__HELP_OPTION_COLOR}--bash-framework-config <String>${__HELP_NORMAL} {single}"
Expand Down Expand Up @@ -1573,7 +1573,7 @@ megalinterCommand() {
# shellcheck disable=SC2054
helpArray=(choose\ color\ theme\ -\ default-force\ means\ colors\ will\ be\ produced\ even\ if\ command\ is\ piped)
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: default'
echo " Default value: default"
echo ' Possible values: default|default-force|noColor'
echo -e " ${__HELP_OPTION_COLOR}--help${__HELP_NORMAL}, ${__HELP_OPTION_COLOR}-h${__HELP_NORMAL} {single}"
local -a helpArray
Expand Down
2 changes: 1 addition & 1 deletion bin/plantuml
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,7 @@ plantumlCommand() {
# shellcheck disable=SC2054
helpArray=(choose\ color\ theme\ -\ default-force\ means\ colors\ will\ be\ produced\ even\ if\ command\ is\ piped)
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: default'
echo " Default value: default"
echo ' Possible values: default|default-force|noColor'
echo -e " ${__HELP_OPTION_COLOR}--help${__HELP_NORMAL}, ${__HELP_OPTION_COLOR}-h${__HELP_NORMAL} {single}"
local -a helpArray
Expand Down
8 changes: 4 additions & 4 deletions bin/runBuildContainer
Original file line number Diff line number Diff line change
Expand Up @@ -1530,21 +1530,21 @@ runBuildContainerCommand() {
# shellcheck disable=SC2054
helpArray=(vendor\ image\ to\ use:\ alpine\|ubuntu)
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: ubuntu'
echo " Default value: ubuntu"
echo ' Possible values: alpine|ubuntu'
echo -e " ${__HELP_OPTION_COLOR}--bash-version <String>${__HELP_NORMAL} {single}"
local -a helpArray
# shellcheck disable=SC2054
helpArray=(version\ of\ bash\ to\ use:\ 4.4\|5.0\|5.1\|5.2)
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: 5.1'
echo " Default value: 5.1"
echo ' Possible values: 4.4|5.0|5.1|5.2'
echo -e " ${__HELP_OPTION_COLOR}--bash-base-image <String>${__HELP_NORMAL} {single}"
local -a helpArray
# shellcheck disable=SC2054
helpArray=(bash\ bash\ image\ to\ use\ \(eg:\ ubuntu:20.04\,\ amd64/bash:4.4-alpine3.18\))
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: ubuntu:20.04'
echo " Default value: ubuntu:20.04"
echo -e " ${__HELP_OPTION_COLOR}--branch-name <String>${__HELP_NORMAL} {single}"
local -a helpArray
# shellcheck disable=SC2054
Expand Down Expand Up @@ -1602,7 +1602,7 @@ runBuildContainerCommand() {
# shellcheck disable=SC2054
helpArray=(choose\ color\ theme\ -\ default-force\ means\ colors\ will\ be\ produced\ even\ if\ command\ is\ piped)
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: default'
echo " Default value: default"
echo ' Possible values: default|default-force|noColor'
echo -e " ${__HELP_OPTION_COLOR}--help${__HELP_NORMAL}, ${__HELP_OPTION_COLOR}-h${__HELP_NORMAL} {single}"
local -a helpArray
Expand Down
4 changes: 2 additions & 2 deletions bin/shellcheckLint
Original file line number Diff line number Diff line change
Expand Up @@ -1635,7 +1635,7 @@ shellcheckLintCommand() {
# shellcheck disable=SC2054
helpArray=(define\ output\ format\ of\ this\ command)
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: tty'
echo " Default value: tty"
echo ' Possible values: checkstyle|diff|gcc|json|json1|quiet|tty'
echo -e " ${__HELP_OPTION_COLOR}--staged${__HELP_NORMAL} {single}"
local -a helpArray
Expand Down Expand Up @@ -1689,7 +1689,7 @@ shellcheckLintCommand() {
# shellcheck disable=SC2054
helpArray=(choose\ color\ theme\ -\ default-force\ means\ colors\ will\ be\ produced\ even\ if\ command\ is\ piped)
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: default'
echo " Default value: default"
echo ' Possible values: default|default-force|noColor'
echo -e " ${__HELP_OPTION_COLOR}--help${__HELP_NORMAL}, ${__HELP_OPTION_COLOR}-h${__HELP_NORMAL} {single}"
local -a helpArray
Expand Down
8 changes: 4 additions & 4 deletions bin/test
Original file line number Diff line number Diff line change
Expand Up @@ -1707,21 +1707,21 @@ testCommand() {
# shellcheck disable=SC2054
helpArray=(vendor\ image\ to\ use:\ alpine\|ubuntu)
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: ubuntu'
echo " Default value: ubuntu"
echo ' Possible values: alpine|ubuntu'
echo -e " ${__HELP_OPTION_COLOR}--bash-version <String>${__HELP_NORMAL} {single}"
local -a helpArray
# shellcheck disable=SC2054
helpArray=(version\ of\ bash\ to\ use:\ 4.4\|5.0\|5.1\|5.2)
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: 5.1'
echo " Default value: 5.1"
echo ' Possible values: 4.4|5.0|5.1|5.2'
echo -e " ${__HELP_OPTION_COLOR}--bash-base-image <String>${__HELP_NORMAL} {single}"
local -a helpArray
# shellcheck disable=SC2054
helpArray=(bash\ bash\ image\ to\ use\ \(eg:\ ubuntu:20.04\,\ amd64/bash:4.4-alpine3.18\))
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: ubuntu:20.04'
echo " Default value: ubuntu:20.04"
echo -e " ${__HELP_OPTION_COLOR}--branch-name <String>${__HELP_NORMAL} {single}"
local -a helpArray
# shellcheck disable=SC2054
Expand Down Expand Up @@ -1779,7 +1779,7 @@ testCommand() {
# shellcheck disable=SC2054
helpArray=(choose\ color\ theme\ -\ default-force\ means\ colors\ will\ be\ produced\ even\ if\ command\ is\ piped)
echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")"
echo ' Default value: default'
echo " Default value: default"
echo ' Possible values: default|default-force|noColor'
echo -e " ${__HELP_OPTION_COLOR}--help${__HELP_NORMAL}, ${__HELP_OPTION_COLOR}-h${__HELP_NORMAL} {single}"
local -a helpArray
Expand Down
38 changes: 38 additions & 0 deletions manualTests/Object::create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash

rootDir="$(cd "$(readlink -e "${BASH_SOURCE[0]%/*}")/.." && pwd -P)"
export FRAMEWORK_ROOT_DIR="${rootDir}"
export _COMPILE_ROOT_DIR="${rootDir}"

srcDir="$(cd "${rootDir}/src" && pwd -P)"

# shellcheck source=src/Options2/__all.sh
source "${srcDir}/Options2/__all.sh"
# shellcheck source=/src/Log/__all.sh
source "${srcDir}/Log/__all.sh"

#set -x
set -o errexit
set -o pipefail
export TMPDIR="/tmp"

Object::create zzzGroupGlobalOptionsFunction \
--type group \
--property-title "GLOBAL OPTIONS:"

Object::create simpleObjectFunction \
--type "Group"

Object::create groupObjectFunction \
--type "Group" \
--property-title "title" \
--property-help "help"

BASH_FRAMEWORK_DISPLAY_LEVEL=__LEVEL_DEBUG

Object::create optionFunction \
--type "Option" \
--property-variableName "varName"

# shellcheck disable=SC2154
Options2::validateOptionObject "${optionFunction}"
21 changes: 21 additions & 0 deletions manualTests/Object::setArray.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

rootDir="$(cd "$(readlink -e "${BASH_SOURCE[0]%/*}")/.." && pwd -P)"
export FRAMEWORK_ROOT_DIR="${rootDir}"
export _COMPILE_ROOT_DIR="${rootDir}"

srcDir="$(cd "${rootDir}/src" && pwd -P)"

# shellcheck source=src/Object/__all.sh
source "${srcDir}/Object/__all.sh"
# shellcheck source=/src/Log/__all.sh
source "${srcDir}/Log/__all.sh"

declare -a missingArrayTerminator=(
--type "missingArrayTerminatorType"
--array-list "elem1" "elem2" "elem3"
--property-property "propertyValue"
)
Object::setArray missingArrayTerminator --array-list "newElem1" "newElem2"

declare -p missingArrayTerminator
19 changes: 19 additions & 0 deletions manualTests/Object::setProperty.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

rootDir="$(cd "$(readlink -e "${BASH_SOURCE[0]%/*}")/.." && pwd -P)"
export FRAMEWORK_ROOT_DIR="${rootDir}"
export _COMPILE_ROOT_DIR="${rootDir}"

srcDir="$(cd "${rootDir}/src" && pwd -P)"

# shellcheck source=src/Object/__all.sh
source "${srcDir}/Object/__all.sh"
# shellcheck source=/src/Log/__all.sh
source "${srcDir}/Log/__all.sh"

declare -a newPropertyObject=(
--type "simpleObjectType"
--property-property "propertyValue"
)
Object::setProperty newPropertyObject --property-newProperty "value"
declare -p newPropertyObject
Loading