From f32935551dbd0bdecefa166044659f76b76e7591 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sat, 10 Mar 2018 20:44:01 +0800 Subject: More function argument checks --- dfly-update | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'dfly-update') 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 @@ -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 cmd_download() { + [ $# -eq 2 ] || exit ${EC_ARGS} local filename="$1" local md5="$2" local url=$(get_image_url ${filename}) -- cgit v1.2.2