From 1a2f956fc1d08d16e6e7e220056bd1fa39a8c2df Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Fri, 27 May 2022 12:08:07 +0200 Subject: lbu: add test for lbu diff usage --- lbu.in | 4 ++-- tests/lbu_test | 7 ++++++- 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 [] __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" +} + -- cgit v1.2.3