summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-05-27 12:08:07 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2022-06-28 18:23:25 +0200
commit1a2f956fc1d08d16e6e7e220056bd1fa39a8c2df (patch)
tree1d404e7866f9b78bacbc076952d2c6e4c7c3e3e2
parentd38b08640e8c063e76ae7c791579d2789473028e (diff)
downloadalpine-conf-1a2f956fc1d08d16e6e7e220056bd1fa39a8c2df.zip
lbu: add test for lbu diff usage
-rw-r--r--lbu.in4
-rwxr-xr-xtests/lbu_test7
2 files changed, 8 insertions, 3 deletions
diff --git a/lbu.in b/lbu.in
index 9155892..bff12a2 100644
--- a/lbu.in
+++ b/lbu.in
@@ -673,13 +673,13 @@ usage_diff() {
usage: $PROGRAM diff [<media>]
__EOF__
- exit 1
+ exit $1
}
cmd_diff() {
local diff_opts=
LBU_MEDIA=${1:-"$LBU_MEDIA"}
- [ -z "$LBU_MEDIA" ] && [ -z "$LBU_BACKUPDIR" ] && usage_diff
+ [ -z "$LBU_MEDIA" ] && [ -z "$LBU_BACKUPDIR" ] && usage_diff "1" >&2
local tmp
init_tmpdir tmp
mkdir -p "$tmp/a" "$tmp/b"
diff --git a/tests/lbu_test b/tests/lbu_test
index 08043fb..e7c1128 100755
--- a/tests/lbu_test
+++ b/tests/lbu_test
@@ -10,7 +10,8 @@ init_tests \
lbu_ci_usage \
lbu_exclude_usage \
lbu_ex_usage \
- lbu_delete_usage
+ lbu_delete_usage \
+ lbu_diff_usage
lbu_usage_body() {
test_usage lbu
@@ -60,3 +61,7 @@ lbu_delete_usage_body() {
lbu delete -h
}
+lbu_diff_usage_body() {
+ test_usage "lbu diff"
+}
+