mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 00:47:10 +09:00
This nicely covers the case when optarg is optional. The same parser can be used when the option string passed to getopt_long() requires a parameter and when it doesn't. The error messages are made consistent. Also fixes a log error c&p in --crash-reboot message.
10 lines
346 B
C
10 lines
346 B
C
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
#pragma once
|
|
|
|
#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);
|