diff options
-rw-r--r-- | lbu.in | 8 | ||||
-rwxr-xr-x | tests/lbu_test | 16 |
2 files changed, 22 insertions, 2 deletions
@@ -380,11 +380,14 @@ usage_list() { usage: $PROGRAM list|ls __EOF__ - exit 1 + exit $1 } cmd_list() { cmd_migrate_include_exclude + if [ "$1" = "-h" ]; then + usage_list 0 + fi _gen_filelist } @@ -776,6 +779,9 @@ while getopts "adehlM:np:qrv" opt ; do ;; v) VERBOSE="$VERBOSE -v" ;; + '?') + usage_$SUBCMD "1" >&2 + ;; esac done shift $(expr $OPTIND - 1) diff --git a/tests/lbu_test b/tests/lbu_test index e7c1128..3c23bcf 100755 --- a/tests/lbu_test +++ b/tests/lbu_test @@ -11,7 +11,9 @@ init_tests \ lbu_exclude_usage \ lbu_ex_usage \ lbu_delete_usage \ - lbu_diff_usage + lbu_diff_usage \ + lbu_list_usage \ + lbu_ls_usage lbu_usage_body() { test_usage lbu @@ -65,3 +67,15 @@ lbu_diff_usage_body() { test_usage "lbu diff" } +lbu_list_usage_body() { + test_usage "lbu list" +} + +lbu_ls_usage_body() { + init_env + atf_check -s exit:0 \ + -o match:"usage: lbu list" \ + -e empty \ + lbu ls -h +} + |