aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2018-03-10 20:44:01 +0800
committerAaron LI <aly@aaronly.me>2018-03-10 20:44:01 +0800
commitf32935551dbd0bdecefa166044659f76b76e7591 (patch)
tree9c7bf09b37f09ee4dd70e4214ea2a71e8c06de11
parentbd0ded70b8cea608666b25c8a00b463ca63d9b0a (diff)
downloaddfly-update-f32935551dbd0bdecefa166044659f76b76e7591.tar.bz2
More function argument checks
-rwxr-xr-xdfly-update10
1 files changed, 7 insertions, 3 deletions
diff --git a/dfly-update b/dfly-update
index cf5bae7..0a438a7 100755
--- a/dfly-update
+++ b/dfly-update
@@ -278,6 +278,7 @@ mount_image() {
#
cmd_version() {
+ [ $# -eq 0 ] || exit ${EC_ARGS}
cat <<_EOF_
v${VERSION}
Aaron LI <aly@aaronly.me>
@@ -286,6 +287,7 @@ _EOF_
}
cmd_usage() {
+ [ $# -eq 0 ] || exit ${EC_ARGS}
cat <<_EOF_
dfly-update - DragonFly BSD update tool using binary release/snapshots
@@ -306,9 +308,10 @@ _EOF_
}
cmd_status() {
- local branch version branch_remote version_remote has_update
- branch=$(get_local_branch)
- version=$(get_local_version)
+ [ $# -eq 0 ] || exit ${EC_ARGS}
+ local branch=$(get_local_branch)
+ local version=$(get_local_version)
+ local branch_remote version_remote has_update
if [ -z "${UPDATE_BRANCH}" ]; then
branch_remote=${branch}
else
@@ -344,6 +347,7 @@ _EOF_
# usage:
# cmd_download <filename> <md5>
cmd_download() {
+ [ $# -eq 2 ] || exit ${EC_ARGS}
local filename="$1"
local md5="$2"
local url=$(get_image_url ${filename})