mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 05:52:36 +02:00
better help text on invalid commands
adding help again is a bad idea. code should never document itself; that's what documentation is for. so, make the code do a better job telling the user where to find documentation. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -15,6 +15,15 @@ tmpgit="$PWD/tmp/gitclone"
|
||||
grubdata="config/data/grub"
|
||||
err="err_"
|
||||
|
||||
badcmd()
|
||||
{
|
||||
errmsg="no context given"
|
||||
[ $# -gt 0 ] && errmsg="$1"
|
||||
|
||||
dstr="Check $projectname docs via $projectsite"
|
||||
[ -d "docs" ] && dstr="$dstr (local docs available via docs/)"
|
||||
$err "Bad command ($errmsg). $dstr"
|
||||
}
|
||||
err_()
|
||||
{
|
||||
printf "ERROR %s: %s\n" "$0" "$1" 1>&2
|
||||
|
||||
Reference in New Issue
Block a user