summaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorjnqnfe <jnqnfe@gmail.com>2015-01-06 03:10:43 +0000
committerLuca Boccassi <bluca@debian.org>2020-03-05 20:37:57 +0000
commitd0eb72a5efd0b1cdbd22f3b5afa3cf16a731b482 (patch)
treef4809e7cc07ff1db94d85aebc41e65a239696967 /functions
parent5a004878721f0bae7f7fe47b51fc86c6f2e76819 (diff)
downloadvyos-live-build-d0eb72a5efd0b1cdbd22f3b5afa3cf16a731b482.tar.gz
vyos-live-build-d0eb72a5efd0b1cdbd22f3b5afa3cf16a731b482.zip
help/usage: avoid unnecessary use of echo helpers
Closes: #952877
Diffstat (limited to 'functions')
-rwxr-xr-xfunctions/help.sh21
-rwxr-xr-xfunctions/usage.sh13
2 files changed, 13 insertions, 21 deletions
diff --git a/functions/help.sh b/functions/help.sh
index b6bc683c9..5e0881795 100755
--- a/functions/help.sh
+++ b/functions/help.sh
@@ -10,27 +10,22 @@
Help ()
{
- Echo "%s - %s" "${PROGRAM}" "${DESCRIPTION}"
- echo
- Echo "Usage:"
- echo
+ printf "%s - %s\n\n" "${PROGRAM}" "${DESCRIPTION}"
+ printf "Usage:\n\n"
if [ -n "${USAGE}" ]
then
- Echo "${USAGE}"
- echo
+ printf "%s\n" "${USAGE}"
fi
- Echo " %s [-h|--help]" "${PROGRAM}"
- Echo " %s [-u|--usage]" "${PROGRAM}"
- Echo " %s [-v|--version]" "${PROGRAM}"
- echo
+ printf " %s [-h|--help]\n" "${PROGRAM}"
+ printf " %s [-u|--usage]\n" "${PROGRAM}"
+ printf " %s [-v|--version]\n\n" "${PROGRAM}"
if [ -n "${HELP}" ]
then
- Echo "${HELP}"
- echo
+ printf "%s\n\n" "${HELP}"
fi
- Echo "Report bugs to the Live Systems project <https://wiki.debian.org/DebianLive>."
+ echo "Report bugs to the Live Systems project <https://wiki.debian.org/DebianLive>."
exit 0
}
diff --git a/functions/usage.sh b/functions/usage.sh
index 86809ad53..038271107 100755
--- a/functions/usage.sh
+++ b/functions/usage.sh
@@ -10,22 +10,19 @@
Usage ()
{
- printf "%s - %s\n" "${PROGRAM}" "${DESCRIPTION}"
- echo
- Echo "Usage:"
- echo
+ printf "%s - %s\n\n" "${PROGRAM}" "${DESCRIPTION}"
+ printf "Usage:\n\n"
if [ -n "${USAGE}" ]
then
- Echo " ${USAGE}"
- echo
+ printf " %s\n" "${USAGE}"
fi
printf " %s [-h|--help]\n" "${PROGRAM}"
printf " %s [-u|--usage]\n" "${PROGRAM}"
printf " %s [-v|--version]\n" "${PROGRAM}"
- echo
- Echo "Try \"%s --help\" for more information." "${PROGRAM}"
+
+ printf "\nTry \"%s --help\" for more information.\n" "${PROGRAM}"
exit 1
}