From a95c249fbc6b556270d91b685b980f0cec986b23 Mon Sep 17 00:00:00 2001
From: P. J. McDermott <pjm@nac.net>
Date: Tue, 31 Jul 2012 21:34:03 -0400
Subject: Add oh_usage and support oh-* utils in oh_help.

---
(limited to 'src')

diff --git a/src/oh-unpacksource.sh b/src/oh-unpacksource.sh
index 128d85a..eb48aed 100644
--- a/src/oh-unpacksource.sh
+++ b/src/oh-unpacksource.sh
@@ -32,6 +32,11 @@ main()
 {
 	oh_locale_set
 
+	if [ "${#}" -ne 0 ]; then
+		oh_usage
+		exit 1
+	fi
+
 	if [ -d ../src ]; then
 		unpack_native
 	else
diff --git a/src/opkbuild.sh b/src/opkbuild.sh
index 94bc6c7..7fdd33d 100644
--- a/src/opkbuild.sh
+++ b/src/opkbuild.sh
@@ -77,6 +77,10 @@ main()
 	oh_locale_set
 
 	get_options
+	if [ "${#}" -ne 0 ]; then
+		oh_usage
+		exit 1
+	fi
 
 	test_uid0_cmd
 
@@ -172,6 +176,7 @@ get_options()
 				;;
 		esac
 	done
+	shift $(($OPTIND - 1))
 
 	# Set default option values.
 	[ -z "${OPT_BUILD}" ] && OPT_BUILD=full
--
cgit v0.9.1