summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lbu.in8
-rwxr-xr-xtests/lbu_test16
2 files changed, 22 insertions, 2 deletions
diff --git a/lbu.in b/lbu.in
index bff12a2..224f06b 100644
--- a/lbu.in
+++ b/lbu.in
@@ -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
+}
+