Articles in this section
| Title | Description | Updated |
|---|---|---|
| Commands | Overview of the Bash Tools Framework command-line tools | 2026-03-02 |
| Framework Overview | Overview of the Bash Tools Framework functions and namespaces | 2026-03-01 |
This is the multi-page printable view of this section. Click here to print.
| Title | Description | Updated |
|---|---|---|
| Commands | Overview of the Bash Tools Framework command-line tools | 2026-03-02 |
| Framework Overview | Overview of the Bash Tools Framework functions and namespaces | 2026-03-01 |
| Title | Description | Updated |
|---|---|---|
| Configuration Files | Understanding configuration file management in Bash Tools Framework | 2026-03-01 |
| Docker Namespace | Using Docker functions in Bash Tools Framework | 2026-03-01 |
| Best Practices | Bash development best practices and recipes | 2026-03-01 |
General framework documentation explaining main framework features:
For creating your first binary file, see the Commands documentation.
Inspired by Evan “Hippy” Slatis work
Configuration files loading is following these rules or best practices:
VAR1=value1
VAR1=value2
BASH_FRAMEWORK_LOG_LEVEL="${BASH_FRAMEWORK_LOG_LEVEL:-0}"
Provide –config argument to see resulting config file + information about order of loaded config files for debugging purpose.
It is also possible to use environment variable, but highly discouraged to generalize this practice as it could lead to unwanted results if variables are not well scoped.
The framework function Env::requireLoad loads the following files in this order if they are existing and are readable:
Options can override values provided by these env files:
BASH_FRAMEWORK_DISPLAY_LEVEL to 3 (INFO)BASH_FRAMEWORK_DISPLAY_LEVEL to 4 (DEBUG)Eg: additional environment files
BASH_FRAMEWORK_ENV_FILES=("${HOME}/.bash-tools/.env" "${HOME}/.env")
Eg: framework default values file
BASH_FRAMEWORK_LOG_LEVEL="${BASH_FRAMEWORK_LOG_LEVEL:-0}"
BASH_FRAMEWORK_DISPLAY_LEVEL="${BASH_FRAMEWORK_DISPLAY_LEVEL:-${__LEVEL_WARNING}}"
BASH_FRAMEWORK_LOG_FILE="${BASH_FRAMEWORK_LOG_FILE:-"${FRAMEWORK_ROOT_DIR}/logs/${SCRIPT_NAME}.log"}"
BASH_FRAMEWORK_LOG_FILE_MAX_ROTATION="${BASH_FRAMEWORK_LOG_FILE_MAX_ROTATION:-5}"
Activity diagram to explain how Env::requireLoad is working:

Usage example: try to pull image from 3 tags in order (from more specific or recent to the less one)
# try to pull image from 3 tags in order (from more specific or recent to the less one)
args=(
'id.dkr.ecr.eu-west-1.amazonaws.com/bash-tools:d93e03d5ab9e127647f575855f605bd189ca8a56'
'id.dkr.ecr.eu-west-1.amazonaws.com/bash-tools:branchName'
'id.dkr.ecr.eu-west-1.amazonaws.com/bash-tools:master'
)
digestPulled="$(Docker::pullImage "${args[@]}")"
# build the image using eventual image pulled as cache
# image will be tagged bash-tools:latest upon successful build
args=(
"." ".docker/Dockerfile" "bash-tools"
# it's important to not double quote following instruction
$(Docker::getBuildCacheFromArg ${digestPulled})
# you can add any additional docker build arg as needed
--build-arg USER_ID="$(id -u)"
--build-arg GROUP_ID="$(id -g)"
)
Docker::buildImage "${args[@]}"
# tag the image with a remote tag
args=(
"id.dkr.ecr.eu-west-1.amazonaws.com/bash-tools"
"bash-tools:latest"
# tags list
"branchName" "d93e03d5ab9e127647f575855f605bd189ca8a56"
)
Docker::tagImage "${args[@]}"
# finally push the image
args=(
"id.dkr.ecr.eu-west-1.amazonaws.com/bash-tools"
"bash-tools:latest"
# tags list
"branchName" "d93e03d5ab9e127647f575855f605bd189ca8a56"
)
Docker::pushImage "${args[@]}"
DISCLAIMER: Some of the best practices mentioned are not fully applied in this project as they were written during development.
The @embed keyword is really useful to inline configuration files. However, to run framework functions using sudo, it
is recommended to call the same binary but passing options to change the behavior. This way the content of the script
file does not seem to be obfuscated.
Follow the framework’s naming conventions:
Namespace::functionName pattern# bats test_tags=ubuntu_only for Ubuntu-specific tests| Title | Description | Updated |
|---|---|---|
| Namespace src/Args | Documentation for src/Args directory | 2026-03-08 |
| Namespace src/Array | Documentation for src/Array directory | 2026-03-08 |
| Namespace src/Assert | Documentation for src/Assert directory | 2026-03-08 |
| Namespace src/Aws | Documentation for src/Aws directory | 2026-03-08 |
| Namespace src/Backup | Documentation for src/Backup directory | 2026-03-08 |
| Namespace src/Bash | Documentation for src/Bash directory | 2026-03-08 |
| Namespace src/Bats | Documentation for src/Bats directory | 2026-03-08 |
| Namespace src/Cache | Documentation for src/Cache directory | 2026-03-08 |
| Namespace src/Command | Documentation for src/Command directory | 2026-03-08 |
| Namespace src/Conf | Documentation for src/Conf directory | 2026-03-08 |
| Namespace src/Crypto | Documentation for src/Crypto directory | 2026-03-08 |
| Namespace src/Database | Documentation for src/Database directory | 2026-03-08 |
| Namespace src/Dns | Documentation for src/Dns directory | 2026-03-08 |
| Namespace src/Docker | Documentation for src/Docker directory | 2026-03-08 |
| Namespace src/Env | Documentation for src/Env directory | 2026-03-08 |
| Namespace src/File | Documentation for src/File directory | 2026-03-08 |
| Namespace src/Filters | Documentation for src/Filters directory | 2026-03-08 |
| Namespace src/Framework | Documentation for src/Framework directory | 2026-03-08 |
| Namespace src/Git | Documentation for src/Git directory | 2026-03-08 |
| Namespace src/Github | Documentation for src/Github directory | 2026-03-08 |
| Namespace src/Install | Documentation for src/Install directory | 2026-03-08 |
| Namespace src/Log | Documentation for src/Log directory | 2026-03-08 |
| Namespace src/Profiles | Documentation for src/Profiles directory | 2026-03-08 |
| Namespace src/Retry | Documentation for src/Retry directory | 2026-03-08 |
| Namespace src/ShellDoc | Documentation for src/ShellDoc directory | 2026-03-08 |
| Namespace src/Softwares | Documentation for src/Softwares directory | 2026-03-08 |
| Namespace src/Ssh | Documentation for src/Ssh directory | 2026-03-08 |
| Namespace src/UI | Documentation for src/UI directory | 2026-03-08 |
| Namespace src/Version | Documentation for src/Version directory | 2026-03-08 |
| Namespace src/Web | Documentation for src/Web directory | 2026-03-08 |
Directory src/Args
file source src/Args/defaultHelp.sh
display help and exits if one of args is -h|–help
-h
short help option
–help
long help option
file source src/Args/defaultHelpNoExit.sh
display help if one of args is -h|–help
-h
short help option
–help
long help option
file source src/Args/showHelp.sh
display help
Directory src/Array
file source src/Array/clone.sh
clone the array passed as parameter
file source src/Array/contains.sh
check if an element is contained in an array
Array::contains "${libPath}" "${__BASH_FRAMEWORK_IMPORTED_FILES[@]}"
concatenate each element of an array with a separator
declare -a array=(test1, test2)
echo "Result= $(Array::join "," "${array[@]})"
Result= test1,test2
file source src/Array/remove.sh
remove elements from array
file source src/Array/removeIf.sh
more performant version of Array:remove remove elements from array using a predicate function
function predicateElem1to5() {
[[ "$1" =~ ^elem[1-5]$ ]] || return 1
}
local -a myArray=("elem1" "elemX" "elem2" "elemX" "elem3" "elemX" "elem4" "elemX" "elem5" "elemX")
Array::removeIf myArray predicateElem1to5
echo "Result: ${myArray[*]}"
## Result: elemX elemX elemX elemX elemX
concatenate each element of an array with a separator but wrapping text when line length is more than provided argument The algorithm will try not to cut the array element if can
file source src/Array/wrap2.sh
concatenate each element of an array with a separator but wrapping text when line length is more than provided argument The algorithm will try not to cut the array element if it can.
Directory src/Assert
file source src/Assert/bashFile.sh
ensure that file begin with a bash shebang
file source src/Assert/bashFrameworkFunction.sh
assert that first arg respects this bash framework naming convention
file source src/Assert/commandExists.sh
check if command specified exists or return 1 with error and message if not
file source src/Assert/curlPingWithRetry.sh
check if ulr provided can be reached (trying if failure)
file source src/Assert/dirEmpty.sh
asserts that directory does not exist check if directory empty using ls -A if pattern provided, apply grep -v with this pattern on ls -A result
file source src/Assert/dirExists.sh
asserts that first argument is directory that exists with specified ownership
file source src/Assert/dirNotExists.sh
asserts that directory does not exist
file source src/Assert/dnsHostname.sh
check if param is valid dns hostname
file source src/Assert/emailAddress.sh
check if param is valid email address
file source src/Assert/emailAddressWithDomain.sh
check if param is valid email address with one the specified domains
file source src/Assert/etcHost.sh
Check if Host is defined in etc/hosts of linux and windows (if applicable)
file source src/Assert/expectGlobalVariables.sh
exits with message if expected global variable is not set
Assert::expectGlobalVariables EXISTING_VAR EXISTING_VAR2
file source src/Assert/expectNonRootUser.sh
exits with message if current user is root
Function has no arguments.
file source src/Assert/expectUser.sh
exits with message if current user is not the expected one
file source src/Assert/fileExecutable.sh
asserts that first argument is a file that exists with specified ownership and is executable
file source src/Assert/fileExists.sh
asserts that first argument is file that exists with specified ownership
file source src/Assert/fileNotExecutable.sh
asserts that first argument is a file that exists with specified ownership and is NOT executable
file source src/Assert/fileNotExists.sh
asserts that file does not exist
file source src/Assert/fileWritable.sh
Checks if file can be created in folder The file does not need to exist
file source src/Assert/firstNameLastName.sh
check if argument respects 2 or more words separated by a space it supports accentuated characters and names with hyphen(-)
file source src/Assert/functionExists.sh
checks if function name provided exists
file source src/Assert/ldapLogin.sh
check if argument respects ldap login naming convention only using lowercase characters a-z
file source src/Assert/posixFunctionName.sh
assert that first arg respects posix function naming convention
file source src/Assert/symLinkValid.sh
asserts that first argument is link to a file that exists
check if tty (interactive mode) is active
Function has no arguments.
file source src/Assert/validPath.sh
check if argument is a valid linux path invalid path are those with:
file source src/Assert/validPosixPath.sh
check if argument is a valid posix linux path and does not contains relative directory
file source src/Assert/validVariableName.sh
check if argument respects this framework variable naming convention
file source src/Assert/varExistsAndNotEmpty.sh
checks if variable name provided exists
file source src/Assert/windows.sh
determine if the script is executed under windows (using wsl)
uname GitBash windows (with wsl) => MINGW64_NT-10.0 ZOXFL-6619QN2 2.10.0(0.325/5/3) 2018-06-13 23:34 x86_64 Msys
uname GitBash windows (wo wsl) => MINGW64_NT-10.0 frsa02-j5cbkc2 2.9.0(0.318/5/3) 2018-01-12 23:37 x86_64 Msys
uname wsl => Linux ZOXFL-6619QN2 4.4.0-17134-Microsoft #112-Microsoft Thu Jun 07 22:57:00 PST 2018 x86_64 x86_64 x86_64 GNU/Linux
determine if the script is executed under WSL
uname GitBash windows (with wsl) => MINGW64_NT-10.0 ZOXFL-6619QN2 2.10.0(0.325/5/3) 2018-06-13 23:34 x86_64 Msys
uname GitBash windows (wo wsl) => MINGW64_NT-10.0 frsa02-j5cbkc2 2.9.0(0.318/5/3) 2018-01-12 23:37 x86_64 Msys
uname wsl => Linux ZOXFL-6619QN2 4.4.0-17134-Microsoft #112-Microsoft Thu Jun 07 22:57:00 PST 2018 x86_64 x86_64 x86_64 GNU/Linux
Directory src/Aws
file source src/Aws/imageExists.sh
Checks if image exists with tags provided on AWS ecr best practice: provide tags ’tagPrefix_shortSha’ ’tagPrefix_branchName' so image will be tagged with
file source src/Aws/requireAwsCommand.sh
ensure command aws is available
Directory src/Backup
Backup given directory in the base directory or in BACKUP_DIR directory backup directory name is composed by following fields separated by _:
file source src/Backup/file.sh
Backup given file in the same directory or in BACKUP_DIR directory backup file name is composed by following fields separated by -:
Directory src/Bash
file source src/Bash/handlePipelineFailure.sh
ignore exit code 141 from simple command pipes
local resultingStatus=0
local -a originalPipeStatus=()
cmd1 | cmd2 || Bash::handlePipelineFailure resultingStatus originalPipeStatus || true
[[ "${resultingStatus}" = "0" ]]
@arg $1 resultingStatusCode:&int (passed by reference) (optional) resulting status code
@arg $2 originalStatus:int[] (passed by reference) (optional) copy of original PIPESTATUS array
@env PIPESTATUS assuming that this function is called like in the example provided
@see https://unix.stackexchange.com/a/709880/582856
@see https://gitlab.alpinelinux.org/alpine/aports/-/issues/11152
@warning alpine does not support PIPESTATUS very well as execution order of piped process is
not guaranteed
Directory src/Bats
file source src/Bats/installRequirementsIfNeeded.sh
install requirements to execute bats
Directory src/Cache
file source src/Cache/getFileContentIfNotExpired.sh
get file content if file not expired
file source src/Cache/getPropertyValue.sh
get property value from file if not present compute it using propertyNotFoundCallback (if provided) and store it in property file
file source src/Cache/getPropertyValue2.sh
get property value from file if not present compute it using propertyNotFoundCallback (if provided) and store it in property file
Directory src/Command
file source src/Command/captureOutputAndExitCode.sh
ability to call a command capturing output and exit code but displaying it also to error output to follow command’s progress command output is sent to COMMAND_OUTPUT and stderr as well in realtime using tee
| Title | Description | Updated |
|---|---|---|
| Namespace src/Compiler/Embed | Documentation for src/Compiler/Embed directory | 2026-03-08 |
Directory src/Compiler/Embed
file source src/Compiler/Embed/extractDirFromBase64.sh
convert base64 encoded back to target dir it is advised to include the md5sum of the binFile in the path of the target dir
file source src/Compiler/Embed/extractFileFromBase64.sh
convert base64 encoded back to target file if target file is executable prepend dir of target file to PATH to make binary available everywhere it is advised to include in the path of the target file the md5sum of the binFile
Directory src/Conf
file source src/Conf/getAbsoluteFile.sh
get absolute conf file from specified conf folder deduced using these rules
file source src/Conf/getMergedList.sh
list the conf files list available in bash-tools/conf/
- default.local
- default.remote
- localhost-root
list files of dir with given extension and display it as a list one by line
- default.local
- default.remote
- localhost-root
@exitcode 1 if directory does not exists
get absolute file from name deduced using these rules
file source src/Conf/loadNearestFile.sh
Load the nearest config file in next example will search first .framework-config file in “srcDir1” then if not found will go in up directories until / then will search in “srcDir2” then if not found will go in up directories until / source the file if found
Conf::loadNearestFile ".framework-config" "srcDir1" "srcDir2"
Directory src/Crypto
file source src/Crypto/uuidV4.sh
generate a UUID in version 4 format
Directory src/Database
file source src/Database/checkDsnFile.sh
check if dsn file has all the mandatory variables set Mandatory variables are: HOSTNAME, USER, PASSWORD, PORT
file source src/Database/createDb.sh
create database if not already existent
file source src/Database/dropDb.sh
drop database if exists
file source src/Database/dropTable.sh
drop table if exists
file source src/Database/dump.sh
dump db limited to optional table list
file source src/Database/getUserDbList.sh
databases’s list of given mysql server
- information_schema
- mysql
- performance_schema
- sys
file source src/Database/ifDbExists.sh
check if given database exists
file source src/Database/isTableExists.sh
check if table exists on given db
file source src/Database/newInstance.sh
create a new db instance Returns immediately if the instance is already initialized
declare -Agx dbInstance
Database::newInstance dbInstance "default.local"
file source src/Database/query.sh
mysql query on a given db
cat file.sql | Database::query ...
@arg $1 instanceQuery:&Map<String,String> (passed by reference) database instance to use
@arg $2 sqlQuery:String (optional) sql query or sql file to execute. if not provided or empty, the command can be piped
@arg $3 dbName:String (optional) the db name
file source src/Database/setDumpOptions.sh
set the options to use on mysqldump command
file source src/Database/setQueryOptions.sh
set the general options to use on mysql command to query the database Differs than setOptions in the way that these options could change each time
file source src/Database/skipColumnNames.sh
by default we skip the column names but sometimes we need column names to display some results disable this option temporarily and then restore it to true
Directory src/Dns
file source src/Dns/addHost.sh
add the line ip hostname at the end of /etc/hosts only if hostname does not exists yet in this file if wsl do the same in ${BASE_MNT_C}/Windows/System32/drivers/etc/hosts
file source src/Dns/checkHostname.sh
try to ping the dns
file source src/Dns/pingHost.sh
try to ping the given hostname
checkout usage doc below
try to docker build image from eventual tagged image cache
You can specify cacheFrom options using the method Docker::getBuildCacheFromArg
## notice that there is no double quotes around $(Docker::getBuildCacheFromArg bash-tools:tag1 bash-tools:tag2)
Docker::buildImage "." "Dockerfile" "bash-tools" $(Docker::getBuildCacheFromArg bash-tools:tag1 bash-tools:tag2)
file source src/Docker/buildPushDockerImage.sh
build image and push it to registry
file source src/Docker/getBuildCacheFromArg.sh
generate list of –cache-from arg to pass to docker build
file source src/Docker/getRemoteTag.sh
generates a string representing a docker remote tag
id.dkr.ecr.eu-west-1.amazonaws.com/bash-tools:v1.0.0
@arg $1 remoteUrl:String eg: id.dkr.ecr.eu-west-1.amazonaws.com
@arg $2 imageName:String eg: bash-tools
@arg $3 tag:String the tag to retrieve (eg: v1.0.0)
@stdout a string representing a docker remote tag
@require Docker::requireDockerCommand
file source src/Docker/getTagCompatibleFromBranch.sh
generates a string compatible with docker tag format Eg: transforms origin/feature/My-beautiful-feature to feature_my_beautiful_feature
file source src/Docker/imageExists.sh
Check if image is tagged on docker registry best practice: provide tags ’tagPrefix_shortSha’ ’tagPrefix_branchName' so image will be tagged with
file source src/Docker/pullImage.sh
try to docker pull image from pullTags arg best practice: provide tags ’tagPrefix_shortSha’ ’tagPrefix_branchName' so image will be tagged with
file source src/Docker/pushImage.sh
push tagged docker image to docker registry best practice: provide tags ’tagPrefix_shortSha’ ’tagPrefix_branchName' so image will be tagged with
file source src/Docker/requireDockerCommand.sh
ensure command docker is available
file source src/Docker/requireDockerComposeCommand.sh
ensure command docker-compose is available
file source src/Docker/tagImage.sh
Image built is tagged with tags provided best practice: provide tags ’tagPrefix_shortSha’ ’tagPrefix_branchName' so image will be tagged with
file source src/Docker/testContainer.sh
Test if a container launched by docker-compose is reachable docker-compose will be up and shutdown at the end of the process if success or not
Directory src/Env
file source src/Env/createDefaultEnvFile.sh
default env file with all default values
file source src/Env/pathAppend.sh
append directories to the PATH environment variable
file source src/Env/pathPrepend.sh
prepend directories to the PATH environment variable
file source src/Env/requireLoad.sh
ensure env files are loaded
Directory src/File
file source src/File/concatenatePath.sh
concatenate 2 paths and ensure the path is correct using realpath -m
file source src/File/detectBashFile.sh
check if file provided is a bash file
file source src/File/elapsedTimeSinceLastModification.sh
get number of seconds since last modification of the file
file source src/File/garbageCollect.sh
delete files older than n days in given path
file source src/File/getAbsolutePath.sh
get absolute file from relative path
file source src/File/insertFileAfterToken.sh
insert file content inside another file after a pattern
file source src/File/insertFileBeforeToken.sh
insert file content inside another file before a pattern
file source src/File/relativeToDir.sh
print the resolved path relative to DIR do not check for path existence
file source src/File/replaceTokenByInput.sh
replace token by input(stdin) in given targetFile
file source src/File/upFind.sh
search a file in parent directories
Directory src/Filters
file source src/Filters/bashFrameworkFunctions.sh
allows to match a bash framework function based on the naming convention
file source src/Filters/camel2snakeCase.sh
transform camel case format to snake case
TEST => test
camelCase2SnakeCase => camel_case2snake_case
origin/featureTest/Tools-1456 => origin/feature_test/tools_1456
# the function is clever enough with some strange case (not really camel case)
featureTEST/TOOLS-1456 => feature_test/tools_1456
innovation/vuecli-with-web => innovation/vuecli_with_web
@stdin the string to filter
@stdout the string converted to snake case
file source src/Filters/commentLines.sh
remove comment lines from input or files provided as arguments
file source src/Filters/firstField.sh
equivalent of awk ‘NR==1{print $1}’ allows to retrieve the first field of a piped input
file source src/Filters/optimizeShFile.sh
remove shebang line, empty lines and comment lines (just the ones with spaces or not before the # Note: comment after command is more difficult to remove because complicated case could occur Eg: # inside strings like in “sed -E -e ’s/#/…..”
file source src/Filters/removeAnsiCodes.sh
remove ansi codes from input or files given as argument
file source src/Filters/removeDuplicatedShebangs.sh
remove all shebangs except the first one
file source src/Filters/removeEmptyLines.sh
remove empty lines and lines containing only spaces
file source src/Filters/removeEmptyLinesFromBeginning.sh
remove empty lines and lines containing only spaces and stops since a non empty line is found
file source src/Filters/removeExternalQuotes.sh
remove quotes (" or ‘) from stdin
echo '"TEST"' => "TEST"
echo '"TEST"' | Filters::removeExternalQuotes # => TEST
@arg $@ files:String[] the files to filter
@exitcode * if one of the filter command fails
@stdin you can use stdin as alternative to files argument
@stdout the filtered content
file source src/Filters/toLowerCase.sh
convert text to lower case
file source src/Filters/toUpperCase.sh
convert text to upper case
file source src/Filters/trimEmptyLines.sh
remove all empty lines
file source src/Filters/trimString.sh
remove leading and trailing spaces of a string
file source src/Filters/uniqUnsorted.sh
uniq command need input file to be sorted here We are using awk that do not need file to be sorted to get uniq values iterates over each file and prints (default awk behavior) each unique line; only takes first value and ignores duplicates Note ! be careful of memory usage as each unique $0 is stored in an array
Directory src/Framework
file source src/Framework/createTempFile.sh
create a temp file using default TMPDIR variable
file source src/Framework/run.sh
run command and store data in global variables
file source src/Framework/trapAdd.sh
appends a command to a trap when you define a trap, an eventual existing trap is replaced by the new one. This method allows to add trap on several signals without removing previous handler.
trap "echo '- SIGUSR1 original'" SIGUSR1
Framework::trapAdd "echo '- SIGUSR1&2 overridden'" SIGUSR1 SIGUSR2
kill -SIGUSR1 $$
## output
## - SIGUSR1 original
## - SIGUSR1&2 overridden
kill -SIGUSR2 $$
## output
## - SIGUSR1&2 overridden
Directory src/Git
file source src/Git/cloneOrPullIfNoChanges.sh
clone the repository if not done yet, else pull it if no change in it
file source src/Git/pullIfNoChanges.sh
pull git directory only if no change has been detected
file source src/Git/requireGitCommand.sh
ensure command git is available
file source src/Git/shallowClone.sh
shallow clone a repository at specific commit sha, tag or branch or update repo if already exists
Directory src/Github
file source src/Github/defaultInstall.sh
download specified release software version from github
file source src/Github/extractRepoFromGithubUrl.sh
github repository eg: kubernetes-sigs/kind
file source src/Github/getLatestRelease.sh
Retrieve the latest version number of a github release using Github API using retry repo arg with fchastanet/bash-tools value would match https://github.com/fchastanet/bash-tools
file source src/Github/getLatestVersionFromUrl.sh
Retrieve the latest version number for given github url
file source src/Github/installRelease.sh
install binary with the exact version provided using retry
releaseUrl argument: the placeholder @latestVersion@ will be replaced by the provided version
file source src/Github/isReleaseVersionExist.sh
check if specified release software version exists in github
file source src/Github/upgradeRelease.sh
upgrade given binary to latest github release using retry
downloadReleaseUrl argument : the placeholder @latestVersion@ will be replaced by the latest release version
Directory src/Install
file source src/Install/dir.sh
install dir to given directory but backup it before
file source src/Install/file.sh
installs file to given directory
callbacks parameters ${fromFile} ${targetFile} $@
file source src/Install/setRootExecutableCallback.sh
install callback set file with root ownership and execution bit
file source src/Install/setUserRightsCallback.sh
install callback set file with root ownership and execution bit
file source src/Install/setUserRootCallback.sh
install callback set file with root ownership
file source src/Install/structure.sh
install dir to given directory but backup it before
file source src/Install/unableToCopyCallback.sh
install callback default callback used called when file copy has failed
| Title | Description | Updated |
|---|---|---|
| Namespace src/Linux/Apt | Documentation for src/Linux/Apt directory | 2026-03-08 |
| Namespace src/Linux/Sudo | Documentation for src/Linux/Sudo directory | 2026-03-08 |
| Namespace src/Linux/Wsl | Documentation for src/Linux/Wsl directory | 2026-03-08 |
Directory src/Linux/Apt
file source src/Linux/Apt/addRepository.sh
add apt repository followed by an apt-get update
file source src/Linux/Apt/install.sh
apt-get install
file source src/Linux/Apt/installIfNecessary.sh
apt-get install if package is not installed yet
file source src/Linux/Apt/isPackageInstalled.sh
check if apt package is installed
file source src/Linux/Apt/remove.sh
remove ubuntu packages
file source src/Linux/Apt/repositoryExists.sh
check if apt repository is added to apt sources Linux::requireSudoCommand
file source src/Linux/Apt/update.sh
update apt packages list
Directory src/Linux/Sudo
file source src/Linux/Sudo/asUser.sh
execute command passed as arguments using sudo if current user is not already the targeted user
file source src/Linux/Sudo/asUserInheritEnv.sh
execute command passed as arguments using sudo with environment inherited if current user is not already the targeted user
Directory src/Linux/Wsl
file source src/Linux/Wsl/assertWindowsEtcHost.sh
Check if Host is defined in etc/hosts of windows
file source src/Linux/Wsl/cachedWslpath.sh
retrieve wslpath using cache (cache is refreshed every day)
file source src/Linux/Wsl/cachedWslpath2.sh
retrieve wslpath using cache (cache is refreshed every day)
file source src/Linux/Wsl/cachedWslpathFromWslVar.sh
retrieve path from wslvar and then use wslpath to resolve it using cache (cache is refreshed every day)
file source src/Linux/Wsl/cachedWslpathFromWslVar2.sh
retrieve path from wslvar and then use wslpath to resolve it using cache (cache is refreshed every day)
file source src/Linux/Wsl/cachedWslvar.sh
retrieve wslvar using cache (cache is refreshed every day)
file source src/Linux/Wsl/cachedWslvar2.sh
retrieve wslvar using cache (cache is refreshed every day)
file source src/Linux/Wsl/getKeyFromWslpathOptions.sh
initialize some important variables for scripts to run correctly when wsl installation is run under wsl is in progress
Function has no arguments.
file source src/Linux/Wsl/originalWslpath.sh
call simply original wslpath command
file source src/Linux/Wsl/originalWslvar.sh
call simply original wslvar command
file source src/Linux/Wsl/requireWsl.sh
ensure linux runs under wsl
Log namespace provides 2 kind of functions
compute duration since last call to this function the result is set in following env variables. in ss.sss (seconds followed by milliseconds precision 3 decimals)
Function has no arguments.
file source src/Log/displayDebug.sh
Display message using debug color (gray)
file source src/Log/displayError.sh
Display message using error color (red)
file source src/Log/displayHelp.sh
Display message using info color (bg light blue/fg white)
file source src/Log/displayInfo.sh
Display message using info color (bg light blue/fg white)
file source src/Log/displaySkipped.sh
Display message using skip color (yellow)
file source src/Log/displayStatus.sh
Display message using info color (blue) but warning level
file source src/Log/displaySuccess.sh
Display message using success color (bg green/fg white)
file source src/Log/displayWarning.sh
Display message using warning color (yellow)
Display message using error color (red) and exit immediately with error status 1
file source src/Log/getLevelText.sh
Get the text representation of a log level
file source src/Log/logDebug.sh
log message to file
file source src/Log/logError.sh
log message to file
file source src/Log/logFatal.sh
log message to file
file source src/Log/logHelp.sh
log message to file
file source src/Log/logInfo.sh
log message to file
file source src/Log/logMessage.sh
Internal: common log message
[date]|[levelMsg]|message
2020-01-19 19:20:21|ERROR |log error
2020-01-19 19:20:21|SKIPPED|log skipped
file source src/Log/logSkipped.sh
log message to file
file source src/Log/logStatus.sh
log message to file
file source src/Log/logSuccess.sh
log message to file
file source src/Log/logWarning.sh
log message to file
file source src/Log/requireLoad.sh
activate or not Log::display* and Log::log* functions based on BASH_FRAMEWORK_DISPLAY_LEVEL and BASH_FRAMEWORK_LOG_LEVEL environment variables loaded by Env::requireLoad try to create log file and rotate it if necessary
Function has no arguments.
To be called before logging in the log file
Directory src/Profiles
file source src/Profiles/allDepsRecursive.sh
get recursively all the dependencies of each config from configs arg
The parent argument must be set to “your software selection” when you call it, then the value will change when this function will be called recursively with the parent dependency
Algorithm For each config in configs - load config definition - mark this config as seen to avoid to recompute it later, in the case where another definition depends on it - call installScripts_${config}_dependencies function if exists (skipped if not) - add these new dependencies if any to current dependencies list - call recursively Profiles::allDepsRecursive with these dependencies - add in allDepsResult the current config if it was not seen yet This has constructed a tree with the most deep dependency present in the first items
file source src/Profiles/checkScriptsExistence.sh
check if dependencies exist path is constructed with following rule ${scriptsDir}/${dependency}${extension}
file source src/Profiles/lintDefinitions.sh
linter that allows to check if a list of methods is defined in each sh file of given scriptsDir
Directory src/Retry
file source src/Retry/default.sh
Retry a command 5 times with a delay of 15 seconds between each attempt
file source src/Retry/parameterized.sh
Retry a command several times depending on parameters
Directory src/ShellDoc
file source src/ShellDoc/fixMarkdownToc.sh
fix markdown TOC generated by Markdown all in one vscode extension to make TOC compatible with docsify
file source src/ShellDoc/generateMdFileFromTemplate.sh
generates markdown file from template by
replacing @@@command_help@@@ by the help of the command
eg: @@@test_help@@@ will be replaced by the output
of the command test --help in the directory provided
file source src/ShellDoc/generateShellDoc.sh
extract shDoc from file
file source src/ShellDoc/generateShellDocDir.sh
generate shell doc file from given directory
file source src/ShellDoc/generateShellDocsFromDir.sh
generate doc + index
file source src/ShellDoc/installRequirementsIfNeeded.sh
install requirements to execute shdoc
Directory src/Softwares
file source src/Softwares/installHadolint.sh
install hadolint if necessary
file source src/Softwares/installShellcheck.sh
install hadolint if necessary
Directory src/Ssh
file source src/Ssh/checkAccess.sh
check if host can accessed using ssh private key without requiring interactivity
file source src/Ssh/fixAuthenticityOfHostCantBeEstablished.sh
Fix ssh issues
file source src/Ssh/requireSshCommand.sh
ensure command ssh is available
file source src/Ssh/requireSshKeygenCommand.sh
ensure command ssh-keygen is available
file source src/Ssh/requireSshKeyscanCommand.sh
ensure command ssh-keyscan is available
Directory src/UI
file source src/UI/askToContinue.sh
ask the user if he wishes to continue a process
Input: user input y or Y characters Output: displays message
Are you sure, you want to continue (y or n)?Exit: with error code 1 if y or Y, other keys do nothing
file source src/UI/askToIgnoreOverwriteAbort.sh
ask the user to ignore(i), overwrite(o) or abort(a)
Input: user input any characters
Output:
do you want to ignore(i), overwrite(o), abort(a) ?
Returns:
file source src/UI/askYesNo.sh
Ask user to enter y or n, retry until answer is correct
[msg arg $1] (y or n)?
file source src/UI/drawLine.sh
draw a line with the character passed in parameter repeated depending on terminal width
file source src/UI/drawLineWithMsg.sh
draw a line with the character passed in parameter repeated depending on terminal width including message in the middle of the screen
file source src/UI/requireTheme.sh
load color theme
Function has no arguments.
file source src/UI/talkToUser.sh
display info message And wall Text to speech to tell the message if wsl and powershell available Else try to use bip
file source src/UI/textLine.sh
Display given text and complete the rest of the line with given character
load colors theme constants
Directory src/Version
file source src/Version/checkMinimal.sh
Check that command version is greater than expected minimal version display warning if command version greater than expected minimal version display error if command version less than expected minimal version and exit 1
file source src/Version/compare.sh
compare 2 version numbers
file source src/Version/getCommandVersionFromPlainText.sh
extract software version number
file source src/Version/githubApiExtractVersion.sh
extract version number from github api
Function has no arguments.
file source src/Version/parse.sh
filter to keep only version number from a string
Directory src/Web
file source src/Web/getReleases.sh
Retrieve the latest version number of a web release
file source src/Web/upgradeRelease.sh
upgrade given binary to latest release using retry
releasesUrl argument : the placeholder @latestVersion@ will be replaced by the latest release version
| Title | Description | Updated |
|---|---|---|
| Commands | Overview of the Bash Tools Framework command-line tools | 2026-03-02 |
| Framework Overview | Overview of the Bash Tools Framework functions and namespaces | 2026-03-01 |
This framework is a collection of several bash functions and commands that helps you to lint files, generate shell documentation, compile bash files, and many more, …
The Bash Tools Framework provides 150+ unit-tested functions organized by namespace. This section provides an overview of the available namespaces and their key functions.
The complete function reference documentation is automatically generated from source code using shdoc. This documentation includes detailed information about:
To generate the documentation:
bin/doc
Here an excerpt of the namespaces available in Bash tools framework:
Apt: several functions to abstract the use of ubuntu apt-get function. these functions are using some default
arguments and manage retry automatically.Linux::Apt::addRepositoryLinux::Apt::installLinux::Apt::removeLinux::Apt::updateArgs: functions to ease some recurrent arguments like -h|–help to display helpArray: functions to ease manipulation of bash arrays like Array::clone or Array::contains that checks if an
element is contained in an arrayAssert: various checks likeAssert::expectUser, Assert::expectNonRootUser, Assert::expectRootUser exits with message if current user is
not the expected oneAssert::commandExists checks if command specified exists or exits with error message if notAssert::windows determines if the script is executed under windows (git bash, wsl)Assert::validPath checks if path provided is a valid linux path, it doesn’t have to exist yetAssert::bashFrameworkFunction checks if given name respects naming convention of this framework’s functionsBackup::file, Backup::dir allows to create a backup of a file or a directory in a folder configured in a .env file
managed by the framework (see Env::requireLoad)Aws: Aim is to abstract the use of some aws cli commands, for the moment only Aws::imageExists has been
implemented allowing to check that a docker image exists with tags provided on AWS ecr(AWS docker repository)Bats::installRequirementsIfNeeded allows to install bats vendor requirements for this project, it uses mainly the
useful function Git::shallowCloneCache : various cache methods to provide files or env variable with expiration managementCommand::captureOutputAndExitCode calls a command capturing output and exit code and displaying it also to error
output to follow command’s progressConf : allows to manage the loading of .env file that contains configuration used by some functions of this
framework.Database : abstraction of several mysql queries, like:Database::dump dump db limited to optional table listDatabase::query mysql query on a given dbDatabase::dropTable drop table if existsDatabase::dropDb drop database if existsDatabase::createDb create database if not already existingDatabase::isTableExists check if table exists on given dbDatabase::ifDbExists check if given database existsDatabase::newInstance in order to reference target db connectionDns : various methods like Dns::pingHost or allowing etc/hosts manipulation.Docker : various docker cli abstractions that allowed to construct bin/buildPushDockerImage command.Env : functions allowing to load env variables or to alter them like Env::pathAppend allowing to add a bin path to
PATH variableFile : files and file paths manipulations.Filters : various functions to filter files using grep, awk or sed eg: Filters::bashFrameworkFunctions allows to
find all the bash framework functions used in a fileGit : provides git abstractions like Git::cloneOrPullIfNoChange, Git::pullIfNoChanges or Git::shallowCloneInstall : copy directory or file, backup them before if needed.Github : major feature is install automatically latest binary release using Github::upgradeReleaseLog::display\* output colored message on error output and log the messageLog::fatal error message in red bold and exits with code 1Log::displayError error message in redLog::displayWarning warning message in yellowLog::displayInfo info message in white on lightBlueLog::displaySuccess success message in greenLog::displayDebug debug message in grayLog::log\* output message in a log fileLog::logErrorLog::logWarningLog::logInfoLog::logSuccessLog::logDebugLog::rotate automatically rotates the log file, this function is used internally by Log::log\* functions.OS: ubuntu related functionsProfiles: methods mainly used by Bash-dev-env project that allows to indicate
scripts list to install with the ability to include all the dependencies recursively. This file
src/Profiles/lintDefinitions.sh is the precursor of a first bash interface implementation.Retry: retry a command on failure easilyShellDoc: this framework shell documentation generationSsh: mainly Ssh::fixAuthenticityOfHostCantBeEstablishedSudo: executes command as sudo if neededUIUI::askToContinue ask the user if he wishes to continue a processUI::askYesNo ask the user a confirmationUI::askToIgnoreOverwriteAbort ask the user to ignore(i), overwrite(o) or abort(a)VersionVersion::checkMinimal ensure that command exists with expected versionVersion::compare compares two versionsWsl: commands wslvar and wslpath are expensive, avoid multiple calls using cachesrc/_standalone regroups methods that do not respect framework naming conventions like assert_lines_count that is
used to assert the number of lines of output in bats testsThis repository uses pre-commit software to ensure every commits respects a set of rules specified by the
.pre-commit-config.yaml file. It supposes pre-commit software is installed in your
environment.
You also have to execute the following command to enable it:
pre-commit install --hook-type pre-commit --hook-type pre-push
All the methods of this framework are unit tested, you can run the unit tests using the following command
./test.sh scrasnups/build:bash-tools-ubuntu-5.3 -r src -j 30
Launch UT on different environments:
./test.sh scrasnups/build:bash-tools-ubuntu-4.4 -r src -j 30
./test.sh scrasnups/build:bash-tools-ubuntu-5.0 -r src -j 30
./test.sh scrasnups/build:bash-tools-ubuntu-5.3 -r src -j 30
./test.sh scrasnups/build:bash-tools-alpine-4.4 -r src -j 30
./test.sh scrasnups/build:bash-tools-alpine-5.0 -r src -j 30
./test.sh scrasnups/build:bash-tools-alpine-5.3 -r src -j 30
use the following command:
vendor/bats/bin/bats -r src/Conf/loadNearestFile.bats --trace --verbose-run --filter "Conf::loadNearestFileFileFoundInDir1"
Alpine with bash version 4.4
docker run --rm -it -w /bash -v "$(pwd):/bash" --entrypoint="" --user 1000:1000 bash-tools-alpine-4.4-user bash
Ubuntu with bash version 5.1
docker run --rm -it -w /bash -v "$(pwd):/bash" --entrypoint="" --user 1000:1000 bash-tools-ubuntu-5.1-user bash
generated by running
bin/doc
The web page uses Hugo with the Docsy theme to generate a static documentation site.
To preview the website locally, you need to clone my-documents repository
git clone git@github.com:fchastanet/my-documents.git
And run the following command from the root of this repository:
SITE=bash-tools-framework make start-site
Navigate to http://localhost:1313/bash-tools-framework/
exit code 127 is returned but process seems to go until the end. This error only occurs on alpine.
commands to compile and debug:
# run docker alpine interactively
docker run --rm -it -w /bash -v "$(pwd):/bash" --entrypoint="" --user 1000:1000 build:bash-tools-alpine-4.4-user bash
# launch bats test that fails
vendor/bats/bin/bats -r src/_binaries/compile.bats --filter embed
# launch directly compile command that returns the same exit code
bin/compile src/_binaries/testsData/bin/embed.sh --template-dir src --bin-dir bin --root-dir $PWD --src-dir src/_binaries/testsData/src
echo $? # prints 127
# try to get more logs
KEEP_TEMP_FILES=1 BASH_FRAMEWORK_DISPLAY_LEVEL=4 bin/compile \
src/_binaries/testsData/bin/embed.sh \
--template-dir src \
--bin-dir bin \
--root-dir "${PWD}" \
--src-dir src/_binaries/testsData/src
# try to use strace
docker run --rm -it \
-w /bash -v "$(pwd):/bash" \
--entrypoint="" \
build:bash-tools-alpine-4.4-user bash
apk update
apk add strace
Strace didn’t helped me a lot. But as I added recently this option shopt -u lastpipe, I removed it from compile binary
and the issue disappeared.
As I was suspecting the while piped inside Compiler::Embed::inject. I added the following code in this function to
remove the tracing just after the error occurs:
trap 'set +x' EXIT
set -x
It allows me to find that the last command executed was read -r line.
Finally I understand that the issue comes when read -r line exits with code 1 because of end of file.
previous simplified code:
cat file | {
local line
while IFS="" read -r line; do
# ...
done
}
Resulting in exit code 127 because of pipe and shopt -u lastpipe.
Fixed code is to remove error if :
cat file | {
local line
while true; do
local status=0
IFS="" read -r line || status=$?
if [[ "${status}" = "1" ]]; then
# end of file
return 0
elif [[ "${status}" != "0" ]]; then
# other error
return "${status}"
fi
# ...
done
}
For comprehensive guides on Bash best practices, please refer to these documents:
This framework is part of a suite of projects:
The Bash Tools Framework provides several command-line tools for linting, building, and managing bash projects.
The framework works with bash-compiler, a GoLang implementation that generates standalone executables from YAML definitions.
Using bash-compiler binary:
export PATH=$PATH:/home/wsl/fchastanet/bash-compiler/bin
FRAMEWORK_ROOT_DIR=$(pwd) bash-compiler \
src/_binaries/shellcheckLint/shellcheckLint-binary.yaml
Using Go interpreter (must be executed from bash-compiler folder):
export FRAMEWORK_ROOT_DIR=/home/wsl/fchastanet/bash-dev-env/vendor/bash-tools-framework
go run ./cmd/bash-compiler "${FRAMEWORK_ROOT_DIR}/src/_binaries/shellcheckLint/shellcheckLint-binary.yaml"
Compile all *-binary.yaml files at once:
export FRAMEWORK_ROOT_DIR=/home/wsl/fchastanet/bash-dev-env/vendor/bash-tools-framework
go run ./cmd/bash-compiler $(find "${FRAMEWORK_ROOT_DIR}/src/_binaries" -name '*-binary.yaml' -print)
See Bash Compiler documentation for more information.
To create a new command using the framework:
src/_binaries/myCommand/myCommand-binary.yamlbin/myCommandSee the framework command template for a starting point.
bin/installRequirements script will install the following libraries inside vendor folder:
bin/doc script will install:
Dependencies are automatically installed when first used. To avoid checking for libraries update and have an impact on performance, a file is created in vendor dir.
vendor/.shdocInstalledvendor/.batsInstalledYou can remove these files to force the update of the libraries, or just wait 24 hours for the timeout to expire 😉
SYNOPSIS:
Installs requirements.
USAGE: installRequirements [OPTIONS]
USAGE: installRequirements [--help|-h] [--config]
[--bash-framework-config <bash-framework-config>] [--verbose|-v] [-vv] [-vvv]
[--log-level <log-level>] [--log-file <log-file>]
[--display-level <display-level>] [--no-color] [--theme <theme>] [--version]
[--quiet|-q]
GLOBAL OPTIONS:
--help, -h {single}
Displays this command help
--config {single}
Displays configuration
--bash-framework-config <bash-framework-config> {single}
Use alternate bash framework configuration.
--verbose, -v {single}
Info level verbose mode (alias of --display-level INFO)
-vv {single}
Debug level verbose mode (alias of --display-level DEBUG)
-vvv {single}
Trace level verbose mode (alias of --display-level TRACE)
--log-level <log-level> {single}
Set log level
Possible values:
- OFF
- ERR
- ERROR
- WARN
- WARNING
- INFO
- DEBUG
- TRACE
Default value: OFF
--log-file <log-file> {single}
Set log file
Default value: /bash/bin/logs/installRequirements.log
--display-level <display-level> {single}
Set display level
Possible values:
- OFF
- ERR
- ERROR
- WARN
- WARNING
- INFO
- DEBUG
- TRACE
Default value: INFO
--no-color {single}
Produce monochrome output. alias of --theme noColor.
--theme <theme> {single}
Choose color theme - default-force means colors will be produced even if
command is piped.
Possible values:
- default
- default-force
- noColor
Default value: default
--version {single}
Print version information and quit.
--quiet, -q {single}
Quiet mode, doesn't display any output.
DESCRIPTION:
Installs requirements:
- bats
- hadolint
- shellcheck
VERSION: 3.0
AUTHOR: [François Chastanet](https://github.com/fchastanet)
SOURCE FILE: https://github.com/fchastanet/bash-tools-framework/tree/master/src/_binaries/installRequirements/installRequirements-binary.yaml
LICENSE: MIT License
Copyright (c) 2024-now François Chastanet
Find files with shebang in a directory.
SYNOPSIS:
find all shebang files of this repository
USAGE: findShebangFiles [OPTIONS]
USAGE: findShebangFiles [--help|-h] [--config]
[--bash-framework-config <bash-framework-config>] [--verbose|-v] [-vv] [-vvv]
[--log-level <log-level>] [--log-file <log-file>]
[--display-level <display-level>] [--no-color] [--theme <theme>] [--version]
[--quiet|-q]
GLOBAL OPTIONS:
--help, -h {single}
Displays this command help
--config {single}
Displays configuration
--bash-framework-config <bash-framework-config> {single}
Use alternate bash framework configuration.
--verbose, -v {single}
Info level verbose mode (alias of --display-level INFO)
-vv {single}
Debug level verbose mode (alias of --display-level DEBUG)
-vvv {single}
Trace level verbose mode (alias of --display-level TRACE)
--log-level <log-level> {single}
Set log level
Possible values:
- OFF
- ERR
- ERROR
- WARN
- WARNING
- INFO
- DEBUG
- TRACE
Default value: OFF
--log-file <log-file> {single}
Set log file
Default value: /bash/bin/logs/findShebangFiles.log
--display-level <display-level> {single}
Set display level
Possible values:
- OFF
- ERR
- ERROR
- WARN
- WARNING
- INFO
- DEBUG
- TRACE
Default value: INFO
--no-color {single}
Produce monochrome output. alias of --theme noColor.
--theme <theme> {single}
Choose color theme - default-force means colors will be produced even if
command is piped.
Possible values:
- default
- default-force
- noColor
Default value: default
--version {single}
Print version information and quit.
--quiet, -q {single}
Quiet mode, doesn't display any output.
DESCRIPTION:
Display list of all files having a bash shebang in the current repository.
You can apply a command to all these files by providing arguments
Example: Add execution bit to all files with a bash shebang
findShebangFiles chmod +x
VERSION: 3.0
AUTHOR: [François Chastanet](https://github.com/fchastanet)
SOURCE FILE: https://github.com/fchastanet/bash-tools-framework/tree/master/src/_binaries/findShebangFiles/findShebangFiles-binary.yaml
LICENSE: MIT License
Copyright (c) 2023-now François Chastanet
Build and push Docker images with proper tagging and caching.
SYNOPSIS:
Lint bash files using shellcheck.
USAGE: buildPushDockerImage [OPTIONS]
USAGE: buildPushDockerImage [--help|-h] [--config]
[--bash-framework-config <bash-framework-config>] [--verbose|-v] [-vv] [-vvv]
[--log-level <log-level>] [--log-file <log-file>]
[--display-level <display-level>] [--no-color] [--theme <theme>] [--version]
[--quiet|-q] [--push] [--vendor <vendor>] [--bash-version <bash-version>]
[--bash-base-image <bash-base-image>]
GLOBAL OPTIONS:
--help, -h {single}
Displays this command help
--config {single}
Displays configuration
--bash-framework-config <bash-framework-config> {single}
Use alternate bash framework configuration.
--verbose, -v {single}
Info level verbose mode (alias of --display-level INFO)
-vv {single}
Debug level verbose mode (alias of --display-level DEBUG)
-vvv {single}
Trace level verbose mode (alias of --display-level TRACE)
--log-level <log-level> {single}
Set log level
Possible values:
- OFF
- ERR
- ERROR
- WARN
- WARNING
- INFO
- DEBUG
- TRACE
Default value: OFF
--log-file <log-file> {single}
Set log file
Default value: /bash/bin/logs/buildPushDockerImage.log
--display-level <display-level> {single}
Set display level
Possible values:
- OFF
- ERR
- ERROR
- WARN
- WARNING
- INFO
- DEBUG
- TRACE
Default value: INFO
--no-color {single}
Produce monochrome output. alias of --theme noColor.
--theme <theme> {single}
Choose color theme - default-force means colors will be produced even if
command is piped.
Possible values:
- default
- default-force
- noColor
Default value: default
--version {single}
Print version information and quit.
--quiet, -q {single}
Quiet mode, doesn't display any output.
OPTIONS:
--push {single}
if provided, push the image to the registry
--vendor <vendor> {single}
vendor image to use
Possible values:
- alpine: alpine based docker image
- ubuntu: ubuntu based docker image
Default value: ubuntu
--bash-version <bash-version> {single}
version of bash to use
Possible values:
- 4.4
- 5.0
- 5.1
- 5.2
Default value: 5.2
--bash-base-image <bash-base-image> {single}
bash bash image to use (eg: ubuntu:20.04, amd64/bash:4.4-alpine3.18)
Default value: ubuntu:20.04
DESCRIPTION:
Pull, build and push docker image:
- pull previous docker image from docker hub if exists
- build new image using previous image as cache
- tag built image
- push it to docker registry
additional docker build options can be passed
via DOCKER_BUILD_OPTIONS env variable
INTERNAL
VERSION: 3.0
AUTHOR: [François Chastanet](https://github.com/fchastanet)
SOURCE FILE: https://github.com/fchastanet/bash-tools-framework/tree/master/src/_binaries/buildPushDockerImage/buildPushDockerImage-binary.yaml
LICENSE: MIT License
Copyright (c) 2023-now François Chastanet
Generate markdown documentation for the framework from source code comments. This command:
.sh filesSYNOPSIS:
Generate markdown documentation.
USAGE: doc [OPTIONS]
USAGE: doc [--ci] [--help|-h] [--config]
[--bash-framework-config <bash-framework-config>] [--verbose|-v] [-vv] [-vvv]
[--log-level <log-level>] [--log-file <log-file>]
[--display-level <display-level>] [--no-color] [--theme <theme>] [--version]
[--quiet|-q]
OPTIONS:
--ci {single}
Activate continuous integration mode (tmp folder not shared with host)
GLOBAL OPTIONS:
--help, -h {single}
Displays this command help
--config {single}
Displays configuration
--bash-framework-config <bash-framework-config> {single}
Use alternate bash framework configuration.
--verbose, -v {single}
Info level verbose mode (alias of --display-level INFO)
-vv {single}
Debug level verbose mode (alias of --display-level DEBUG)
-vvv {single}
Trace level verbose mode (alias of --display-level TRACE)
--log-level <log-level> {single}
Set log level
Possible values:
- OFF
- ERR
- ERROR
- WARN
- WARNING
- INFO
- DEBUG
- TRACE
Default value: OFF
--log-file <log-file> {single}
Set log file
Default value: /bash/bin/logs/doc.log
--display-level <display-level> {single}
Set display level
Possible values:
- OFF
- ERR
- ERROR
- WARN
- WARNING
- INFO
- DEBUG
- TRACE
Default value: INFO
--no-color {single}
Produce monochrome output. alias of --theme noColor.
--theme <theme> {single}
Choose color theme - default-force means colors will be produced even if
command is piped.
Possible values:
- default
- default-force
- noColor
Default value: default
--version {single}
Print version information and quit.
--quiet, -q {single}
Quiet mode, doesn't display any output.
DESCRIPTION:
INTERNAL TOOL
VERSION: 3.0
AUTHOR: [François Chastanet](https://github.com/fchastanet)
SOURCE FILE: https://github.com/fchastanet/bash-tools-framework/tree/master/src/_binaries/doc/doc-binary.yaml
LICENSE: MIT License
Copyright (c) 2022-now François Chastanet
Run unit tests using bats inside Docker container with needed dependencies.
# Run all tests on Ubuntu Bash 5.3
./test.sh scrasnups/build:bash-tools-ubuntu-5.3 -r src -j 30
# Run specific test file
./test.sh scrasnups/build:bash-tools-ubuntu-5.3 src/Array/contains.bats
# Run on different environments
./test.sh scrasnups/build:bash-tools-ubuntu-4.4 -r src -j 30
./test.sh scrasnups/build:bash-tools-ubuntu-5.0 -r src -j 30
./test.sh scrasnups/build:bash-tools-ubuntu-5.3 -r src -j 30
./test.sh scrasnups/build:bash-tools-alpine-4.4 -r src -j 30
./test.sh scrasnups/build:bash-tools-alpine-5.0 -r src -j 30
./test.sh scrasnups/build:bash-tools-alpine-5.3 -r src -j 30
Lint files of the current repository to ensure framework conventions are followed.
This linter is used in pre-commit hooks. See .pre-commit-config.yaml.
SYNOPSIS:
Lint files of the current repository to ensure framework conventions
are followed.
USAGE: frameworkLint [OPTIONS]
USAGE: frameworkLint [--help|-h] [--config]
[--bash-framework-config <bash-framework-config>] [--verbose|-v] [-vv] [-vvv]
[--log-level <log-level>] [--log-file <log-file>]
[--display-level <display-level>] [--no-color] [--theme <theme>] [--version]
[--quiet|-q] [--format <format>]
[--expected-warnings-count <expected-warnings-count>]
GLOBAL OPTIONS:
--help, -h {single}
Displays this command help
--config {single}
Displays configuration
--bash-framework-config <bash-framework-config> {single}
Use alternate bash framework configuration.
--verbose, -v {single}
Info level verbose mode (alias of --display-level INFO)
-vv {single}
Debug level verbose mode (alias of --display-level DEBUG)
-vvv {single}
Trace level verbose mode (alias of --display-level TRACE)
--log-level <log-level> {single}
Set log level
Possible values:
- OFF
- ERR
- ERROR
- WARN
- WARNING
- INFO
- DEBUG
- TRACE
Default value: OFF
--log-file <log-file> {single}
Set log file
Default value: /bash/bin/logs/frameworkLint.log
--display-level <display-level> {single}
Set display level
Possible values:
- OFF
- ERR
- ERROR
- WARN
- WARNING
- INFO
- DEBUG
- TRACE
Default value: INFO
--no-color {single}
Produce monochrome output. alias of --theme noColor.
--theme <theme> {single}
Choose color theme - default-force means colors will be produced even if
command is piped.
Possible values:
- default
- default-force
- noColor
Default value: default
--version {single}
Print version information and quit.
--quiet, -q {single}
Quiet mode, doesn't display any output.
OPTIONS:
--format <format> {single}
Define output format of this command.
Possible values:
- plain
- checkstyle
Default value: plain
--expected-warnings-count <expected-warnings-count> {single}
Specify expected warning count (default: 0)
DESCRIPTION:
Lint files of the current repository
- check if all Namespace::functions are existing in the framework
- check that function defined in a .sh is correctly named
- check each function has a bats file associated
- shdoc - check that shdoc valid annotations are used
- check that @require function matches naming convention and exists
- check that at least @description is provided
VERSION: 3.0
AUTHOR: [François Chastanet](https://github.com/fchastanet)
SOURCE FILE: https://github.com/fchastanet/bash-tools-framework/tree/master/src/_binaries/frameworkLint/frameworkLint-binary.yaml
LICENSE: MIT License
Copyright (c) 2023-now François Chastanet
Hadolint wrapper with automatic installation of hadolint.
SYNOPSIS:
Lint docker files of the given directory using hadolint.
USAGE: dockerLint [OPTIONS] [ARGUMENTS]
USAGE: dockerLint [--help|-h] [--config]
[--bash-framework-config <bash-framework-config>] [--verbose|-v] [-vv] [-vvv]
[--log-level <log-level>] [--log-file <log-file>]
[--display-level <display-level>] [--no-color] [--theme <theme>] [--version]
[--quiet|-q]
ARGUMENTS:
[hadolintArguments {list} (optional)] hadolint arguments
GLOBAL OPTIONS:
--help, -h {single}
Displays this command help
--config {single}
Displays configuration
--bash-framework-config <bash-framework-config> {single}
Use alternate bash framework configuration.
--verbose, -v {single}
Info level verbose mode (alias of --display-level INFO)
-vv {single}
Debug level verbose mode (alias of --display-level DEBUG)
-vvv {single}
Trace level verbose mode (alias of --display-level TRACE)
--log-level <log-level> {single}
Set log level
Possible values:
- OFF
- ERR
- ERROR
- WARN
- WARNING
- INFO
- DEBUG
- TRACE
Default value: OFF
--log-file <log-file> {single}
Set log file
Default value: /bash/bin/logs/dockerLint.log
--display-level <display-level> {single}
Set display level
Possible values:
- OFF
- ERR
- ERROR
- WARN
- WARNING
- INFO
- DEBUG
- TRACE
Default value: INFO
--no-color {single}
Produce monochrome output. alias of --theme noColor.
--theme <theme> {single}
Choose color theme - default-force means colors will be produced even if
command is piped.
Possible values:
- default
- default-force
- noColor
Default value: default
--version {single}
Print version information and quit.
--quiet, -q {single}
Quiet mode, doesn't display any output.
DESCRIPTION:
- installs new hadolint version(>2.12.0) automatically
- lint this project files using default files filter
HADOLINT HELP:
hadolint - Dockerfile Linter written in Haskell
Usage: hadolint [-v|--version] [-c|--config FILENAME] [DOCKERFILE...]
[--file-path-in-report FILEPATHINREPORT] [--no-fail]
[--no-color] [-V|--verbose] [-f|--format ARG] [--error RULECODE]
[--warning RULECODE] [--info RULECODE] [--style RULECODE]
[--ignore RULECODE]
[--trusted-registry REGISTRY (e.g. docker.io)]
[--require-label LABELSCHEMA (e.g. maintainer:text)]
[--strict-labels] [--disable-ignore-pragma]
[-t|--failure-threshold THRESHOLD]
Lint Dockerfile for errors and best practices
Available options:
-h,--help Show this help text
-v,--version Show version
-c,--config FILENAME Path to the configuration file
--file-path-in-report FILEPATHINREPORT
The file path referenced in the generated report.
This only applies for the 'checkstyle' format and is
useful when running Hadolint with Docker to set the
correct file path.
--no-fail Don't exit with a failure status code when any rule
is violated
--no-color Don't colorize output
-V,--verbose Enables verbose logging of hadolint's output to
stderr
-f,--format ARG The output format for the results [tty | json |
checkstyle | codeclimate | gitlab_codeclimate | gnu |
codacy | sonarqube | sarif] (default: tty)
--error RULECODE Make the rule `RULECODE` have the level `error`
--warning RULECODE Make the rule `RULECODE` have the level `warning`
--info RULECODE Make the rule `RULECODE` have the level `info`
--style RULECODE Make the rule `RULECODE` have the level `style`
--ignore RULECODE A rule to ignore. If present, the ignore list in the
config file is ignored
--trusted-registry REGISTRY (e.g. docker.io)
A docker registry to allow to appear in FROM
instructions
--require-label LABELSCHEMA (e.g. maintainer:text)
The option --require-label=label:format makes
Hadolint check that the label `label` conforms to
format requirement `format`
--strict-labels Do not permit labels other than specified in
`label-schema`
--disable-ignore-pragma Disable inline ignore pragmas `# hadolint
ignore=DLxxxx`
-t,--failure-threshold THRESHOLD
Exit with failure code only when rules with a
severity equal to or above THRESHOLD are violated.
Accepted values: [error | warning | info | style |
ignore | none] (default: info)
VERSION: 3.0
AUTHOR: [François Chastanet](https://github.com/fchastanet)
SOURCE FILE: https://github.com/fchastanet/bash-tools-framework/tree/master/src/_binaries/dockerLint/dockerLint-binary.yaml
LICENSE: MIT License
Copyright (c) 2022-now François Chastanet
ShellCheck wrapper with automatic installation of ShellCheck.
SYNOPSIS:
Lint bash files using shellcheck.
USAGE: shellcheckLint [OPTIONS] [ARGUMENTS]
USAGE: shellcheckLint [--help|-h] [--config]
[--bash-framework-config <bash-framework-config>] [--verbose|-v] [-vv] [-vvv]
[--log-level <log-level>] [--log-file <log-file>]
[--display-level <display-level>] [--no-color] [--theme <theme>] [--version]
[--quiet|-q] [--format|-f <format>] [--staged] [--xargs]
ARGUMENTS:
[shellcheckFiles {list} (optional)] files to validate with shellcheck.
If not provided, all files from git repository which are beginning
with a bash shebang, unless --staged option is provided.
GLOBAL OPTIONS:
--help, -h {single}
Displays this command help
--config {single}
Displays configuration
--bash-framework-config <bash-framework-config> {single}
Use alternate bash framework configuration.
--verbose, -v {single}
Info level verbose mode (alias of --display-level INFO)
-vv {single}
Debug level verbose mode (alias of --display-level DEBUG)
-vvv {single}
Trace level verbose mode (alias of --display-level TRACE)
--log-level <log-level> {single}
Set log level
Possible values:
- OFF
- ERR
- ERROR
- WARN
- WARNING
- INFO
- DEBUG
- TRACE
Default value: OFF
--log-file <log-file> {single}
Set log file
Default value: /bash/bin/logs/shellcheckLint.log
--display-level <display-level> {single}
Set display level
Possible values:
- OFF
- ERR
- ERROR
- WARN
- WARNING
- INFO
- DEBUG
- TRACE
Default value: INFO
--no-color {single}
Produce monochrome output. alias of --theme noColor.
--theme <theme> {single}
Choose color theme - default-force means colors will be produced even if
command is piped.
Possible values:
- default
- default-force
- noColor
Default value: default
--version {single}
Print version information and quit.
--quiet, -q {single}
Quiet mode, doesn't display any output.
SPECIFIC OPTIONS:
--format, -f <format> {single}
define output format of this command
Possible values:
- checkstyle
- diff
- gcc
- json
- json1
- quiet
- tty
Default value: tty
--staged {single}
lint only staged git files(files added to file list to be committed)
and which are beginning with a bash shebang.
--xargs {single}
uses parallelization(using xargs command) only if tty format
DESCRIPTION:
shellcheck wrapper that will:
- install new shellcheck version(0.9.0) automatically
- by default, lint all git files of this project
which are beginning with a bash shebang
except if the option --staged is passed
Special configuration .shellcheckrc:
use the following line in your .shellcheckrc file to exclude
some files from being checked (use grep -E syntax) exclude=^bin/compile$
SHELLCHECK HELP
Usage: shellcheck [OPTIONS...] FILES...
-a --check-sourced Include warnings from sourced files
-C[WHEN] --color[=WHEN] Use color (auto, always, never)
-i CODE1,CODE2.. --include=CODE1,CODE2.. Consider only given types of warnings
-e CODE1,CODE2.. --exclude=CODE1,CODE2.. Exclude types of warnings
--extended-analysis=bool Perform dataflow analysis (default true)
-f FORMAT --format=FORMAT Output format (checkstyle, diff, gcc, json, json1, quiet, tty)
--list-optional List checks disabled by default
--norc Don't look for .shellcheckrc files
--rcfile=RCFILE Prefer the specified configuration file over searching for one
-o check1,check2.. --enable=check1,check2.. List of optional checks to enable (or 'all')
-P SOURCEPATHS --source-path=SOURCEPATHS Specify path when looking for sourced files ("SCRIPTDIR" for script's dir)
-s SHELLNAME --shell=SHELLNAME Specify dialect (sh, bash, dash, ksh, busybox)
-S SEVERITY --severity=SEVERITY Minimum severity of errors to consider (error, warning, info, style)
-V --version Print version information
-W NUM --wiki-link-count=NUM The number of wiki links to show, when applicable
-x --external-sources Allow 'source' outside of FILES
--help Show this usage summary and exit
VERSION: 3.0
AUTHOR: [François Chastanet](https://github.com/fchastanet)
SOURCE FILE: https://github.com/fchastanet/bash-tools-framework/tree/master/src/_binaries/shellcheckLint/shellcheckLint-binary.yaml
LICENSE: MIT License
Copyright (c) 2022-now François Chastanet
Lint all files with .awk extension in specified folder.
SYNOPSIS:
lint awk files
USAGE: awkLint [OPTIONS]
USAGE: awkLint [--help|-h] [--config]
[--bash-framework-config <bash-framework-config>] [--verbose|-v] [-vv] [-vvv]
[--log-level <log-level>] [--log-file <log-file>]
[--display-level <display-level>] [--no-color] [--theme <theme>] [--version]
[--quiet|-q]
GLOBAL OPTIONS:
--help, -h {single}
Displays this command help
--config {single}
Displays configuration
--bash-framework-config <bash-framework-config> {single}
Use alternate bash framework configuration.
--verbose, -v {single}
Info level verbose mode (alias of --display-level INFO)
-vv {single}
Debug level verbose mode (alias of --display-level DEBUG)
-vvv {single}
Trace level verbose mode (alias of --display-level TRACE)
--log-level <log-level> {single}
Set log level
Possible values:
- OFF
- ERR
- ERROR
- WARN
- WARNING
- INFO
- DEBUG
- TRACE
Default value: OFF
--log-file <log-file> {single}
Set log file
Default value: /bash/bin/logs/awkLint.log
--display-level <display-level> {single}
Set display level
Possible values:
- OFF
- ERR
- ERROR
- WARN
- WARNING
- INFO
- DEBUG
- TRACE
Default value: INFO
--no-color {single}
Produce monochrome output. alias of --theme noColor.
--theme <theme> {single}
Choose color theme - default-force means colors will be produced even if
command is piped.
Possible values:
- default
- default-force
- noColor
Default value: default
--version {single}
Print version information and quit.
--quiet, -q {single}
Quiet mode, doesn't display any output.
DESCRIPTION:
Lint awk files
Lint all files with .awk extension in current git folder.
Result in checkstyle format.
VERSION: 3.0
AUTHOR: [François Chastanet](https://github.com/fchastanet)
SOURCE FILE: https://github.com/fchastanet/bash-tools-framework/tree/master/src/_binaries/awkLint/awkLint-binary.yaml
LICENSE: MIT License
Copyright (c) 2022-now François Chastanet
Lint binary definition files (YAML).
SYNOPSIS:
Lint files of the given directory.
USAGE: definitionLint [OPTIONS] [ARGUMENTS]
USAGE: definitionLint [--format <format>] [--help|-h] [--config]
[--bash-framework-config <bash-framework-config>] [--verbose|-v] [-vv] [-vvv]
[--log-level <log-level>] [--log-file <log-file>]
[--display-level <display-level>] [--no-color] [--theme <theme>] [--version]
[--quiet|-q]
ARGUMENTS:
folder {single} (mandatory) the folder to recursively lint
OPTIONS:
--format <format> {single}
Define output format of this command.
Possible values:
- plain
- checkstyle
Default value: plain
GLOBAL OPTIONS:
--help, -h {single}
Displays this command help
--config {single}
Displays configuration
--bash-framework-config <bash-framework-config> {single}
Use alternate bash framework configuration.
--verbose, -v {single}
Info level verbose mode (alias of --display-level INFO)
-vv {single}
Debug level verbose mode (alias of --display-level DEBUG)
-vvv {single}
Trace level verbose mode (alias of --display-level TRACE)
--log-level <log-level> {single}
Set log level
Possible values:
- OFF
- ERR
- ERROR
- WARN
- WARNING
- INFO
- DEBUG
- TRACE
Default value: OFF
--log-file <log-file> {single}
Set log file
Default value: /bash/bin/logs/definitionLint.log
--display-level <display-level> {single}
Set display level
Possible values:
- OFF
- ERR
- ERROR
- WARN
- WARNING
- INFO
- DEBUG
- TRACE
Default value: INFO
--no-color {single}
Produce monochrome output. alias of --theme noColor.
--theme <theme> {single}
Choose color theme - default-force means colors will be produced even if
command is piped.
Possible values:
- default
- default-force
- noColor
Default value: default
--version {single}
Print version information and quit.
--quiet, -q {single}
Quiet mode, doesn't display any output.
DESCRIPTION:
For each definition file:
- check that all mandatory methods are existing
installScripts_<fileName>_helpDescription
installScripts_<fileName>_helpVariables
installScripts_<fileName>_listVariables
installScripts_<fileName>_defaultVariables
installScripts_<fileName>_checkVariables
installScripts_<fileName>_fortunes
installScripts_<fileName>_dependencies
installScripts_<fileName>_breakOnConfigFailure
installScripts_<fileName>_breakOnTestFailure
installScripts_<fileName>_install
installScripts_<fileName>_configure
installScripts_<fileName>_test
- check if other definitions files functions are defined by currently
linted definition file it would mean that another file has defined
the same methods
- check if each dependency exists
INTERNAL
VERSION: 3.0
AUTHOR: [François Chastanet](https://github.com/fchastanet)
SOURCE FILE: https://github.com/fchastanet/bash-tools-framework/tree/master/src/_binaries/definitionLint/definitionLint-binary.yaml
LICENSE: MIT License
Copyright (c) 2023-now François Chastanet
Run MegaLinter for comprehensive code quality checks.
SYNOPSIS:
Run megalinter over this repository.
USAGE: megalinter [OPTIONS]
USAGE: megalinter [--help|-h] [--config]
[--bash-framework-config <bash-framework-config>] [--verbose|-v] [-vv] [-vvv]
[--log-level <log-level>] [--log-file <log-file>]
[--display-level <display-level>] [--no-color] [--theme <theme>] [--version]
[--quiet|-q] [--format <<Format>>] [--fix] [--filesOnly] [--incremental|-i]
[--image <<ImageName>>] [--config-file <<ConfigFile>>]
[--check-megalinter-version]
GLOBAL OPTIONS:
--help, -h {single}
Displays this command help
--config {single}
Displays configuration
--bash-framework-config <bash-framework-config> {single}
Use alternate bash framework configuration.
--verbose, -v {single}
Info level verbose mode (alias of --display-level INFO)
-vv {single}
Debug level verbose mode (alias of --display-level DEBUG)
-vvv {single}
Trace level verbose mode (alias of --display-level TRACE)
--log-level <log-level> {single}
Set log level
Possible values:
- OFF
- ERR
- ERROR
- WARN
- WARNING
- INFO
- DEBUG
- TRACE
Default value: OFF
--log-file <log-file> {single}
Set log file
Default value: /bash/bin/logs/megalinter.log
--display-level <display-level> {single}
Set display level
Possible values:
- OFF
- ERR
- ERROR
- WARN
- WARNING
- INFO
- DEBUG
- TRACE
Default value: INFO
--no-color {single}
Produce monochrome output. alias of --theme noColor.
--theme <theme> {single}
Choose color theme - default-force means colors will be produced even if
command is piped.
Possible values:
- default
- default-force
- noColor
Default value: default
--version {single}
Print version information and quit.
--quiet, -q {single}
Quiet mode, doesn't display any output.
OPTIONS:
--format <<Format>> {single}
Define output format of this command.
Possible values:
- plain
- json
Default value: plain
--fix {single}
Apply linters fixes automatically.
--filesOnly {single}
Skip linters that run in project mode.
--incremental, -i {single}
Run megalinter only on files that are git staged.
--image <<ImageName>> {single}
Specify docker megalinter image name to use.
Default value: oxsecurity/megalinter-terraform:v9
--config-file <<ConfigFile>> {single}
Specify megalinter config filename to use.
Default value: .mega-linter.yml
--check-megalinter-version {single}
Check if new version of megalinter is available (compared to default ima
ge). Exits 1 if yes and displays new version number.
DESCRIPTION:
megalinter image will be used.
<files> optionally you can provide a list of files to run megalinter on
this mode is incompatible with --incremental option.
VERSION: 3.0
AUTHOR: [François Chastanet](https://github.com/fchastanet)
SOURCE FILE: https://github.com/fchastanet/bash-tools-framework/tree/master/src/_binaries/megalinter/megalinter-binary.yaml
LICENSE: MIT License
Copyright (c) 2023-now François Chastanet
Generate PlantUML diagrams.
SYNOPSIS:
Generates plantuml diagrams from puml files.
USAGE: plantuml [OPTIONS] [ARGUMENTS]
USAGE: plantuml [--help|-h] [--config]
[--bash-framework-config <bash-framework-config>] [--verbose|-v] [-vv] [-vvv]
[--log-level <log-level>] [--log-file <log-file>]
[--display-level <display-level>] [--no-color] [--theme <theme>] [--version]
[--quiet|-q] [--ci] [--format|-f <Format>] [--limit-size|-l <LimitSize>]
[--same-dir] [--output-dir|-o <OutputDir>] [--include-path <IncludePath>]
ARGUMENTS:
[PlantumlFiles {list} (optional)] Plantuml files (if not provided, deduce files
from git repository with .puml extension)
GLOBAL OPTIONS:
--help, -h {single}
Displays this command help
--config {single}
Displays configuration
--bash-framework-config <bash-framework-config> {single}
Use alternate bash framework configuration.
--verbose, -v {single}
Info level verbose mode (alias of --display-level INFO)
-vv {single}
Debug level verbose mode (alias of --display-level DEBUG)
-vvv {single}
Trace level verbose mode (alias of --display-level TRACE)
--log-level <log-level> {single}
Set log level
Possible values:
- OFF
- ERR
- ERROR
- WARN
- WARNING
- INFO
- DEBUG
- TRACE
Default value: OFF
--log-file <log-file> {single}
Set log file
Default value: /bash/bin/logs/plantuml.log
--display-level <display-level> {single}
Set display level
Possible values:
- OFF
- ERR
- ERROR
- WARN
- WARNING
- INFO
- DEBUG
- TRACE
Default value: INFO
--no-color {single}
Produce monochrome output. alias of --theme noColor.
--theme <theme> {single}
Choose color theme - default-force means colors will be produced even if
command is piped.
Possible values:
- default
- default-force
- noColor
Default value: default
--version {single}
Print version information and quit.
--quiet, -q {single}
Quiet mode, doesn't display any output.
OPTIONS:
--ci {single}
Activate continuous integration mode (tmp folder not shared with host)
--format, -f <Format> {list} (optional)
Defines output format of this command
Possible values:
- svg
- png
--limit-size, -l <LimitSize> {single}
Define PLANTUML_LIMIT_SIZE
use plantuml software default size if not provided
Default value: 0
--same-dir {single}
Write image file in same directory as source file
and with the same base name (except extension)
Incompatible with the option --output-dir
--output-dir, -o <OutputDir> {single}
Define output directory of this command (default: <currentDirectory>)
Incompatible with the option --same-dir
--include-path <IncludePath> {single}
Make the path specified shared inside docker container
so that !include directives in plantuml files can work
relative to this path.
If not provided, the current directory will be used as include path.
Default value: -
DESCRIPTION:
Generates plantuml diagrams from puml files in formats provided
PLANTUML HELP
docker was not available while generating this documentation
VERSION: 3.0
AUTHOR: [François Chastanet](https://github.com/fchastanet)
SOURCE FILE: https://github.com/fchastanet/bash-tools-framework/tree/master/src/_binaries/plantuml/plantuml-binary.yaml
LICENSE: MIT License
Copyright (c) 2023-now François Chastanet