basic/argv-util: drop unused code

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2026-08-26 12:15:16 +02:00
parent 9d2178b4a8
commit ed595e6b67
3 changed files with 0 additions and 41 deletions
-27
View File
@@ -13,7 +13,6 @@
#include "path-util.h"
#include "process-util.h"
#include "string-util.h"
#include "strv.h"
int saved_argc = 0;
char **saved_argv = NULL;
@@ -69,32 +68,6 @@ bool invoked_by_systemd(void) {
return cached;
}
bool argv_looks_like_help(int argc, char **argv) {
char **l;
/* Scans the command line for indications the user asks for help. This is supposed to be called by
* tools that do not implement getopt()-style command line parsing because they are not primarily
* user-facing. Detects four ways of asking for help:
*
* 1. Passing zero arguments
* 2. Passing "help" as first argument
* 3. Passing --help as any argument
* 4. Passing -h as any argument
*/
assert(argc == 0 || argv);
if (argc <= 1)
return true;
if (streq_ptr(argv[1], "help"))
return true;
l = strv_skip(argv, 1);
return strv_contains(l, "--help") ||
strv_contains(l, "-h");
}
static int update_argv(const char name[], size_t l) {
static int can_do = -1;
int r;
-1
View File
@@ -10,7 +10,6 @@ void save_argc_argv(int argc, char **argv);
bool invoked_as(char *argv[], const char *token);
bool invoked_by_systemd(void) _const_;
bool argv_looks_like_help(int argc, char **argv);
int rename_process_full(const char *comm, const char *invocation);
static inline int rename_process(const char *name) {