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:
Leah Rowe
2024-06-03 00:17:36 +01:00
parent afac9a06d2
commit 00653aab1e
4 changed files with 17 additions and 8 deletions
+1 -1
View File
@@ -69,7 +69,7 @@ main()
handle_serprog()
{
[ -z "${1+x}" ] && $err "bad command. Check $projectname docs."
[ -z "${1+x}" ] && badcmd
[ "$1" != "rp2040" ] && [ "$1" != "stm32" ] && $err "bad command"
if [ "$1" = "rp2040" ]; then
serprog_boards_dir="$picosdk/src/boards/include/boards"
+1 -1
View File
@@ -27,7 +27,7 @@ main()
-s) mode="savedefconfig" ;;
-l) mode="olddefconfig" ;;
-n) mode="nconfig" ;;
*) $err "Invalid option" ;;
*) badcmd "invalid option '-$option'" ;;
esac
shift; project="${OPTARG#src/}"; shift
done