tree-wide: unify some code that looks for --help in the command line

This commit is contained in:
Lennart Poettering
2022-03-31 11:44:46 +02:00
parent 9959d78280
commit 542bb9be7c
6 changed files with 36 additions and 12 deletions
+3 -5
View File
@@ -12,9 +12,10 @@
#include "log.h"
#include "main-func.h"
#include "memory-util.h"
#include "path-util.h"
#include "parse-util.h"
#include "path-util.h"
#include "pretty-print.h"
#include "process-util.h"
#include "string-util.h"
#include "terminal-util.h"
@@ -90,10 +91,7 @@ static int run(int argc, char *argv[]) {
int r;
char *action, *volume;
if (argc <= 1 ||
strv_contains(strv_skip(argv, 1), "--help") ||
strv_contains(strv_skip(argv, 1), "-h") ||
streq(argv[1], "help"))
if (argv_looks_like_help(argc, argv))
return help();
if (argc < 3)