diff options
author | Aaron LI <aly@aaronly.me> | 2018-03-10 20:44:01 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2018-03-10 20:44:01 +0800 |
commit | f32935551dbd0bdecefa166044659f76b76e7591 (patch) | |
tree | 9c7bf09b37f09ee4dd70e4214ea2a71e8c06de11 | |
parent | bd0ded70b8cea608666b25c8a00b463ca63d9b0a (diff) | |
download | dfly-update-f32935551dbd0bdecefa166044659f76b76e7591.tar.bz2 |
More function argument checks
-rwxr-xr-x | dfly-update | 10 |
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}) |