[PATCH] polybase_add_course argument check and help
Export this patch
Signed-off-by: Luc-Saccoccio <lucsaccoccio@disroot.org>
---
polybase_add_course | 3 +++
1 file changed, 3 insertions(+)
diff --git a/polybase_add_course b/polybase_add_course
index 02f2c27..4d8bd5d 100755
--- a/polybase_add_course
+++ b/polybase_add_course
@@ -7,6 +7,9 @@ die() {
exit 1
}
+[ "$#" -ne 5 ] && die "Illegal number of arguments
+Usage: polybase_add_course [code] [kind] [part] [name] [quantity]"
+
sqlite3 "$DB" 'PRAGMA user_version=0' || die "No write access to database"
sqlite3 "$DB" "INSERT INTO courses VALUES ('$1', '$2', $3, '$4', $5);"
--
2.38.1