Merge pull request #18596 from keszybz/systemctl-quiet-legend
systemctl: hide legends with --quiet, allow overriding
This commit is contained in:
@@ -10,6 +10,27 @@
|
||||
|
||||
/* All functions in this file emit warnigs. */
|
||||
|
||||
int parse_boolean_argument(const char *optname, const char *s, bool *ret) {
|
||||
int r;
|
||||
|
||||
/* Returns the result through *ret and the return value. */
|
||||
|
||||
if (s) {
|
||||
r = parse_boolean(s);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to parse boolean argument to %s: %s.", optname, s);
|
||||
|
||||
if (ret)
|
||||
*ret = r;
|
||||
return r;
|
||||
} else {
|
||||
/* s may be NULL. This is controlled by getopt_long() parameters. */
|
||||
if (ret)
|
||||
*ret = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
int parse_json_argument(const char *s, JsonFormatFlags *ret) {
|
||||
assert(s);
|
||||
assert(ret);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "json.h"
|
||||
|
||||
int parse_boolean_argument(const char *optname, const char *s, bool *ret);
|
||||
int parse_json_argument(const char *s, JsonFormatFlags *ret);
|
||||
int parse_path_argument(const char *path, bool suppress_root, char **arg);
|
||||
int parse_signal_argument(const char *s, int *ret);
|
||||
|
||||
Reference in New Issue
Block a user