summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lbu.in6
-rwxr-xr-xtests/lbu_test22
2 files changed, 24 insertions, 4 deletions
diff --git a/lbu.in b/lbu.in
index 3a94d36..9155892 100644
--- a/lbu.in
+++ b/lbu.in
@@ -522,18 +522,18 @@ usage_exclude() {
-r Remove specified file(s) from exclude list instead of adding.
-v Verbose mode.
__EOF__
- exit 1
+ exit $1
}
cmd_exclude() {
cmd_migrate_include_exclude
if [ "$LIST" ] ; then
- [ $# -gt 0 ] && usage_exclude
+ [ $# -gt 0 ] && usage_exclude "1" >&2
show_exclude
return
fi
- [ $# -lt 1 ] && usage_exclude
+ [ $# -lt 1 ] && usage_exclude "1" >&2
if [ "$REMOVE" ] ; then
list_delete - "$@"
else
diff --git a/tests/lbu_test b/tests/lbu_test
index 9be325d..08043fb 100755
--- a/tests/lbu_test
+++ b/tests/lbu_test
@@ -7,7 +7,10 @@ init_tests \
lbu_inc_usage \
lbu_add_usage \
lbu_commit_usage \
- lbu_ci_usage
+ lbu_ci_usage \
+ lbu_exclude_usage \
+ lbu_ex_usage \
+ lbu_delete_usage
lbu_usage_body() {
test_usage lbu
@@ -40,3 +43,20 @@ lbu_ci_usage_body() {
-e empty \
lbu ci -h
}
+
+lbu_exclude_usage_body() {
+ test_usage "lbu exclude"
+}
+
+lbu_ex_usage_body() {
+ test_usage "lbu ex"
+}
+
+lbu_delete_usage_body() {
+ init_env
+ atf_check -s exit:0 \
+ -o match:"usage: lbu exclude" \
+ -e empty \
+ lbu delete -h
+}
+