diff --git a/bin/postmanCli b/bin/postmanCli index 65abd4b7..182892e6 100755 --- a/bin/postmanCli +++ b/bin/postmanCli @@ -1929,8 +1929,8 @@ postmanCliCommand() { echo -e "${__HELP_TITLE_COLOR}ARGUMENTS:${__RESET_COLOR}" echo -e " [${__HELP_OPTION_COLOR}command${__HELP_NORMAL} {single}]" local -a helpArray - # shellcheck disable=SC2054 - helpArray=($'\e[1;34mpull\r\n Pull collections from Postman back to repositories.\r\n\e[1;34mpush\r\n Push repositories collections to Postman.') + # shellcheck disable=SC2054,SC2206 + mapfile -t helpArray < <(argCommandHelp) echo -e " $(Array::wrap2 " " 76 4 "${helpArray[@]}")" echo -e " [${__HELP_OPTION_COLOR}commandArgs${__HELP_NORMAL} {list} (optional)]" local -a helpArray @@ -2042,6 +2042,13 @@ postmanCliCommand() { declare optionPostmanModelConfig="$(pwd -P)/postmanCli.collections.json" declare copyrightBeginYear="2023" +argCommandHelp() { + echo "${__HELP_OPTION_COLOR}pull${__HELP_NORMAL}" $'\r' + echo " Pull collections from Postman back to repositories." $'\r' + echo "${__HELP_OPTION_COLOR}push${__HELP_NORMAL}" $'\r' + echo ' Push repositories collections to Postman.' +} + # shellcheck disable=SC2317 # if function is overridden unknownOption() { commandArgs+=("$1") diff --git a/src/_binaries/Postman/command.postmanCli.tpl b/src/_binaries/Postman/command.postmanCli.tpl index fcc11883..e46935a3 100644 --- a/src/_binaries/Postman/command.postmanCli.tpl +++ b/src/_binaries/Postman/command.postmanCli.tpl @@ -26,16 +26,14 @@ Default value: /postmanCli.collections.json' \ --variable-name "optionPostmanModelConfig" \ --function-name optionPostmanModelConfigFunction + argCommandHelp() { :; } Options::generateArg \ --variable-name "argCommand" \ --min 0 \ --max 1 \ --name "command" \ --authorized-values 'pull|push' \ - --help $'${__HELP_OPTION_COLOR}pull${__HELP_NORMAL}\r - Pull collections from Postman back to repositories.\r -${__HELP_OPTION_COLOR}push${__HELP_NORMAL}\r - Push repositories collections to Postman.' \ + --help argCommandHelp \ --function-name argCommandFunction Options::generateArg \ @@ -62,6 +60,13 @@ Options::generateCommand "${options[@]}" declare optionPostmanModelConfig="$(pwd -P)/postmanCli.collections.json" declare copyrightBeginYear="2023" +argCommandHelp() { + echo "${__HELP_OPTION_COLOR}pull${__HELP_NORMAL}" $'\r' + echo " Pull collections from Postman back to repositories." $'\r' + echo "${__HELP_OPTION_COLOR}push${__HELP_NORMAL}" $'\r' + echo ' Push repositories collections to Postman.' +} + # shellcheck disable=SC2317 # if function is overridden unknownOption() { commandArgs+=("$1") diff --git a/src/_binaries/Postman/testsData/postmanCli.help.txt b/src/_binaries/Postman/testsData/postmanCli.help.txt index 04c6028a..78dc41e6 100644 --- a/src/_binaries/Postman/testsData/postmanCli.help.txt +++ b/src/_binaries/Postman/testsData/postmanCli.help.txt @@ -10,8 +10,10 @@ Push/Pull postman collections of all the configured repositories ARGUMENTS: [command {single}] - pull   Pull collections from Postman back to repositories. - push   Push repositories collections to Postman. + pull + Pull collections from Postman back to repositories. + push + Push repositories collections to Postman. [commandArgs {list} (optional)] list of postman collection's references to pull or push or no argument to pull or push all the collections