From 96c9dd06a80c981a9d9fa5c9effe72136df96660 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sun, 6 Jan 2019 20:45:49 +0800 Subject: Merge "version" sub-command into "help" Improve the help text a bit. --- dfly-update | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/dfly-update b/dfly-update index bfe2206..971b1a2 100755 --- a/dfly-update +++ b/dfly-update @@ -378,24 +378,16 @@ _EOF_ # Sub-command functions # -cmd_version() { - cat <<_EOF_ -v${VERSION} -Aaron LI -https://github.com/liweitianux/dfly-update -_EOF_ -} - cmd_usage() { cat <<_EOF_ dfly-update - DragonFly BSD update tool using binary release/snapshots -Usage: +Usage: ${0##*/} + +Sub-commands: help | --help | -h Show this help. - version | --version | -v - Show version information of this tool. - mount + mount Mount the given image file backup Back up the current kernel and world @@ -403,11 +395,13 @@ Usage: Install the new kernel, world, and config files cleanup Clean up obsolete files, umount and remove image file - fly | go + fly Synthetic command to upgrade the system! + +v${VERSION} +Aaron LI +https://github.com/liweitianux/dfly-update _EOF_ - echo - cmd_version } # Mount the given image file @@ -471,8 +465,7 @@ cmd_fly() { # Load configurations [ -r "${CONFIGFILE}" ] && . ${CONFIGFILE} -COMMAND="$1" -case "${COMMAND}" in +case $1 in mount) shift cmd_mount "$@" @@ -489,13 +482,10 @@ case "${COMMAND}" in shift cmd_cleanup ;; - fly|go) + fly) shift cmd_fly "$@" ;; - version|--version|-v) - cmd_version - ;; help|--help|-h|*) cmd_usage ;; -- cgit v1.2.2