help/usage: simplify

Gbp-Dch: Ignore
This commit is contained in:
Lyndon Brown 2020-03-06 22:08:07 +00:00 committed by Luca Boccassi
parent bc199a73b6
commit 9f1fdac303
2 changed files with 19 additions and 19 deletions

View File

@ -10,21 +10,22 @@
Help ()
{
printf "%s - %s\n\n" "${PROGRAM_NAME}" "${DESCRIPTION}"
printf "Usage:\n\n"
echo "${PROGRAM_NAME} - ${DESCRIPTION}"
printf "\nUsage:\n\n"
if [ -n "${USAGE}" ]
then
# printf without placeholder required here for correct \t and \n formatting of `lb config --usage`
if [ -n "${USAGE}" ]; then
# printf without placeholder required here for correct \t and \n formatting of `lb config` usage string
printf " ${USAGE}\n"
fi
printf " %s [-h|--help]\n" "${PROGRAM}"
printf " %s [-u|--usage]\n" "${PROGRAM}"
printf " %s [-v|--version]\n\n" "${PROGRAM}"
echo " ${PROGRAM} [-h|--help]"
echo " ${PROGRAM} [-u|--usage]"
echo " ${PROGRAM} [-v|--version]"
echo
if [ -n "${HELP}" ]
then
printf "%s\n\n" "${HELP}"
printf "${HELP}\n\n"
fi
echo "Report bugs to the Live Systems project <https://wiki.debian.org/DebianLive>."

View File

@ -10,20 +10,19 @@
Usage ()
{
printf "%s - %s\n\n" "${PROGRAM_NAME}" "${DESCRIPTION}"
printf "Usage:\n\n"
echo "${PROGRAM_NAME} - ${DESCRIPTION}"
printf "\nUsage:\n\n"
if [ -n "${USAGE}" ]
then
# printf without placeholder required here for correct \t and \n formatting of `lb config --usage`
if [ -n "${USAGE}" ]; then
# printf without placeholder required here for correct \t and \n formatting of `lb config` usage string
printf " ${USAGE}\n"
fi
printf " %s [-h|--help]\n" "${PROGRAM}"
printf " %s [-u|--usage]\n" "${PROGRAM}"
printf " %s [-v|--version]\n" "${PROGRAM}"
printf "\nTry \"%s --help\" for more information.\n" "${PROGRAM}"
echo " ${PROGRAM} [-h|--help]"
echo " ${PROGRAM} [-u|--usage]"
echo " ${PROGRAM} [-v|--version]"
echo
echo "Try \"${PROGRAM} --help\" for more information."
exit 1
}