Use the `--` argument delimiter to avoid spurious warnings about
arguments starting with `-`.
kas-container | 115 ++++++++++++++++++++++++++------------------------
1 file changed, 59 insertions(+), 56 deletions(-)
diff --git a/kas-container b/kas-container
index 416ef2d..508bc8f 100755
--- a/kas-container
+++ b/kas-container
@@ -40,62 +40,65 @@ usage()
EXIT_CODE="$1"
SELF="${KAS_CONTAINER_SELF_NAME}"
- printf "%b" "Usage: ${SELF} [OPTIONS] { build | shell } [KASOPTIONS] [KASFILE]\n"
- printf "%b" " ${SELF} [OPTIONS] { checkout | dump | lock } [KASOPTIONS] [KASFILE]\n"
- printf "%b" " ${SELF} [OPTIONS] { diff } [KASOPTIONS] config1 config2\n"
- printf "%b" " ${SELF} [OPTIONS] for-all-repos [KASOPTIONS] [KASFILE] COMMAND\n"
- printf "%b" " ${SELF} [OPTIONS] { clean | cleansstate | cleanall | purge} [KASFILE]\n"
- printf "%b" " ${SELF} [OPTIONS] menu [KCONFIG]\n"
- printf "%b" "\nPositional arguments:\n"
- printf "%b" "build\t\t\tCheck out repositories and build target.\n"
- printf "%b" "checkout\t\tCheck out repositories but do not build.\n"
- printf "%b" "diff\t\t\tCompare two kas configurations.\n"
- printf "%b" "dump\t\t\tCheck out repositories and write flat version\n"
- printf "%b" " \t\t\tof config to stdout.\n"
- printf "%b" "lock\t\t\tCreate and update kas project lockfiles.\n"
- printf "%b" "shell\t\t\tRun a shell in the build environment.\n"
- printf "%b" "for-all-repos\t\tRun specified command in each repository.\n"
- printf "%b" "clean\t\t\tClean build artifacts, keep sstate cache and " \
- "downloads.\n"
- printf "%b" "cleansstate\t\tClean build artifacts and sstate cache, " \
- "keep downloads.\n"
- printf "%b" "cleanall\t\tClean build artifacts, sstate cache and " \
- "downloads.\n"
- printf "%b" "purge\t\t\tRemove all data managed by kas. Run with '--dry-run'\n"
- printf "%b" " \t\t\tto check what would be removed.\n"
- printf "%b" "menu\t\t\tProvide configuration menu and trigger " \
- "configured build.\n"
- printf "%b" "\nOptional arguments:\n"
- printf "%b" "--isar-privileged\tRun an Isar build in privileged mode. " \
- "To force the use\n"
- printf "%b" "\t\t\tof run0 over sudo, set KAS_SUDO_CMD=run0.\n"
- printf "%b" "--isar-rootless\t\tRun an Isar build in rootless mode.\n"
- printf "%b" "--runtime-args\t\tAdditional arguments to pass to the " \
- "container runtime.\n"
- printf "%b" "\t\t\tfor running the build.\n"
- printf "%b" "-l, --log-level\t\tSet log level (default=info).\n"
- printf "%b" "--version\t\tPrint program version.\n"
- printf "%b" "--ssh-dir\t\tDirectory containing SSH configurations.\n"
- printf "%b" "\t\t\tAvoid \$HOME/.ssh unless you fully trust the " \
- "container.\n"
- printf "%b" "--ssh-agent\t\tForward ssh-agent socket to the container.\n"
- printf "%b" "--aws-dir\t\tDirectory containing AWScli configuration.\n"
- printf "%b" "\t\t\tAvoid \$HOME/.aws unless you fully trust the " \
- "container.\n"
- printf "%b" "--git-credential-store\tFile path to the git credential " \
- "store.\n"
- printf "%b" "--git-credential-socket\tPath to the git credential cache " \
- "socket.\n"
- printf "%b" "--no-proxy-from-env\tDo not inherit proxy settings from " \
- "environment.\n"
- printf "%b" "--repo-ro\t\tMount current repository read-only\n" \
- "\t\t\t(default for build command).\n"
- printf "%b" "--repo-rw\t\tMount current repository writable\n" \
- "\t\t\t(default for shell command).\n"
- printf "%b" "-h, --help\t\tShow this help message and exit.\n"
- printf "%b" "\n"
- printf "%b" "You can force the use of podman over docker using " \
- "KAS_CONTAINER_ENGINE=podman.\n"
+ printf -- 'Usage: %s [OPTIONS] { build | shell } [KASOPTIONS] [KASFILE]\n' "${SELF}"
+ printf -- ' %s [OPTIONS] { checkout | dump | lock } [KASOPTIONS] [KASFILE]\n' "${SELF}"
+ printf -- ' %s [OPTIONS] { diff } [KASOPTIONS] config1 config2\n' "${SELF}"
+ printf -- ' %s [OPTIONS] for-all-repos [KASOPTIONS] [KASFILE] COMMAND\n' "${SELF}"
+ printf -- ' %s [OPTIONS] { clean | cleansstate | cleanall | purge} [KASFILE]\n' "${SELF}"
+ printf -- ' %s [OPTIONS] menu [KCONFIG]\n' "${SELF}"
+ printf -- '\nPositional arguments:\n'
+ printf -- 'build\t\t\tCheck out repositories and build target.\n'
+ printf -- 'checkout\t\tCheck out repositories but do not build.\n'
+ printf -- 'diff\t\t\tCompare two kas configurations.\n'
+ printf -- 'dump\t\t\tCheck out repositories and write flat version\n'
+ printf -- ' \t\t\tof config to stdout.\n'
+ printf -- 'lock\t\t\tCreate and update kas project lockfiles.\n'
+ printf -- 'shell\t\t\tRun a shell in the build environment.\n'
+ printf -- 'for-all-repos\t\tRun specified command in each repository.\n'
+ printf -- 'clean\t\t\tClean build artifacts, keep sstate cache and %b' \
+ 'downloads.\n'
+ printf -- 'cleansstate\t\tClean build artifacts and sstate cache, %b' \
+ 'keep downloads.\n'
+ printf -- 'cleanall\t\tClean build artifacts, sstate cache and %b' \
+ 'downloads.\n'
+ printf -- 'purge\t\t\tRemove all data managed by kas. Run with '--dry-run'\n'
+ printf -- ' \t\t\tto check what would be removed.\n'
+ printf -- 'menu\t\t\tProvide configuration menu and trigger %b' \
+ 'configured build.\n'
+ printf -- '\nOptional arguments:\n'
+ printf -- '--isar-privileged\tRun an Isar build in privileged mode. %b' \
+ 'To force the use\n'
+ printf -- '\t\t\tof run0 over sudo, set KAS_SUDO_CMD=run0.\n'
+ printf -- '--isar-rootless\t\tRun an Isar build in rootless mode.\n'
+ printf -- '--runtime-args\t\tAdditional arguments to pass to the %b' \
+ 'container runtime.\n'
+ printf -- '\t\t\tfor running the build.\n'
+ printf -- '-l, --log-level\t\tSet log level (default=info).\n'
+ printf -- '--version\t\tPrint program version.\n'
+ printf -- '--ssh-dir\t\tDirectory containing SSH configurations.\n'
+ # SC2016: Expressions don't expand in single quotes, use double quotes for that.
+ # shellcheck disable=2016
+ printf -- '\t\t\tAvoid $HOME/.ssh unless you fully trust the %b' \
+ 'container.\n'
+ printf -- '--ssh-agent\t\tForward ssh-agent socket to the container.\n'
+ printf -- '--aws-dir\t\tDirectory containing AWScli configuration.\n'
+ # shellcheck disable=2016
+ printf -- '\t\t\tAvoid $HOME/.aws unless you fully trust the %b' \
+ 'container.\n'
+ printf -- '--git-credential-store\tFile path to the git credential %b' \
+ 'store.\n'
+ printf -- '--git-credential-socket\tPath to the git credential cache %b' \
+ 'socket.\n'
+ printf -- '--no-proxy-from-env\tDo not inherit proxy settings from %b' \
+ 'environment.\n'
+ printf -- '--repo-ro\t\tMount current repository read-only\n%b' \
+ '\t\t\t(default for build command).\n'
+ printf -- '--repo-rw\t\tMount current repository writable\n%b' \
+ '\t\t\t(default for shell command).\n'
+ printf -- '-h, --help\t\tShow this help message and exit.\n'
+ printf -- '\n'
+ printf -- 'You can force the use of podman over docker using %b' \
+ 'KAS_CONTAINER_ENGINE=podman.\n'
exit "${EXIT_CODE:-1}"
}
--
2.47.3