Переглянути джерело

mkplatformfs, mkrootfs: show help if no args

classabbyamp 1 рік тому
батько
коміт
a7698238e2
2 змінених файлів з 10 додано та 0 видалено
  1. 5 0
      mkplatformfs.sh
  2. 5 0
      mkrootfs.sh

+ 5 - 0
mkplatformfs.sh

@@ -97,6 +97,11 @@ shift $((OPTIND - 1))
 PLATFORM="$1"
 BASE_TARBALL="$2"
 
+if [ -z "$PLATFORM" ] || [ -z "$BASE_TARBALL" ]; then
+	usage >&2
+	exit 1
+fi
+
 # This is an aweful hack since the script isn't using privesc
 # mechanisms selectively.  This is a TODO item.
 if [ "$(id -u)" -ne 0 ]; then

+ 5 - 0
mkrootfs.sh

@@ -95,6 +95,11 @@ done
 shift $((OPTIND - 1))
 XBPS_TARGET_ARCH="$1"
 
+if [ -z "$XBPS_TARGET_ARCH" ]; then
+	usage >&2
+	exit 1
+fi
+
 # Set the XBPS cache
 set_cachedir