mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-09-02 15:25:27 +00:00
parser: enable printing Werror flag settings
Make it so --Werror=show can display which flags have been set. In addition update its --help=Werror flag table to display ./apparmor_parser --Werror=[Option] instead of --Warn MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/600 Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
@@ -468,9 +468,10 @@ static int process_arg(int c, char *optarg)
|
|||||||
strcmp(optarg, "optimize") == 0 ||
|
strcmp(optarg, "optimize") == 0 ||
|
||||||
strcmp(optarg, "O") == 0) {
|
strcmp(optarg, "O") == 0) {
|
||||||
flagtable_help("-O ", "", progname, optflag_table);
|
flagtable_help("-O ", "", progname, optflag_table);
|
||||||
} else if (strcmp(optarg, "warn") == 0 ||
|
} else if (strcmp(optarg, "warn") == 0) {
|
||||||
strcmp(optarg, "Werror") == 0) {
|
|
||||||
flagtable_help("--warn=", "", progname, warnflag_table);
|
flagtable_help("--warn=", "", progname, warnflag_table);
|
||||||
|
} else if (strcmp(optarg, "Werror") == 0) {
|
||||||
|
flagtable_help("--Werror=", "", progname, warnflag_table);
|
||||||
} else {
|
} else {
|
||||||
PERROR("%s: Invalid --help option %s\n",
|
PERROR("%s: Invalid --help option %s\n",
|
||||||
progname, optarg);
|
progname, optarg);
|
||||||
@@ -703,6 +704,8 @@ static int process_arg(int c, char *optarg)
|
|||||||
case ARG_WERROR:
|
case ARG_WERROR:
|
||||||
if (!optarg) {
|
if (!optarg) {
|
||||||
werrflags = -1;
|
werrflags = -1;
|
||||||
|
} else if (strcmp(optarg, "show") == 0) {
|
||||||
|
print_flags("Werror", warnflag_table, werrflags);
|
||||||
} else if (optarg && !handle_flag_table(warnflag_table, optarg,
|
} else if (optarg && !handle_flag_table(warnflag_table, optarg,
|
||||||
&werrflags)) {
|
&werrflags)) {
|
||||||
PERROR("%s: Invalid --Werror option %s\n",
|
PERROR("%s: Invalid --Werror option %s\n",
|
||||||
|
Reference in New Issue
Block a user