From: Zbigniew Jędrzejewski-Szmek Date: Sat, 31 Jul 2021 07:00:11 +0000 (+0200) Subject: veritysetup: print help for --help/-h/help X-Git-Tag: v250-rc1~882^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5d5e43cc33637a12f743f17294cfbd3ede08a1b3;p=thirdparty%2Fsystemd.git veritysetup: print help for --help/-h/help In general our commands print help on --help, but here this would trigger the error that two arguments are needed. Let's make this more user-friendly. --- diff --git a/src/veritysetup/veritysetup.c b/src/veritysetup/veritysetup.c index 34208dcd876..14d7462ddbc 100644 --- a/src/veritysetup/veritysetup.c +++ b/src/veritysetup/veritysetup.c @@ -130,7 +130,10 @@ static int run(int argc, char *argv[]) { _cleanup_(crypt_freep) struct crypt_device *cd = NULL; int r; - if (argc <= 1) + if (argc <= 1 || + strv_contains(strv_skip(argv, 1), "--help") || + strv_contains(strv_skip(argv, 1), "-h") || + streq(argv[1], "help")) return help(); if (argc < 3)