mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01: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:
parent
9c1803d62a
commit
3d7cfb29f9
1 changed files with 5 additions and 2 deletions
|
@ -468,9 +468,10 @@ static int process_arg(int c, char *optarg)
|
|||
strcmp(optarg, "optimize") == 0 ||
|
||||
strcmp(optarg, "O") == 0) {
|
||||
flagtable_help("-O ", "", progname, optflag_table);
|
||||
} else if (strcmp(optarg, "warn") == 0 ||
|
||||
strcmp(optarg, "Werror") == 0) {
|
||||
} else if (strcmp(optarg, "warn") == 0) {
|
||||
flagtable_help("--warn=", "", progname, warnflag_table);
|
||||
} else if (strcmp(optarg, "Werror") == 0) {
|
||||
flagtable_help("--Werror=", "", progname, warnflag_table);
|
||||
} else {
|
||||
PERROR("%s: Invalid --help option %s\n",
|
||||
progname, optarg);
|
||||
|
@ -703,6 +704,8 @@ static int process_arg(int c, char *optarg)
|
|||
case ARG_WERROR:
|
||||
if (!optarg) {
|
||||
werrflags = -1;
|
||||
} else if (strcmp(optarg, "show") == 0) {
|
||||
print_flags("Werror", warnflag_table, werrflags);
|
||||
} else if (optarg && !handle_flag_table(warnflag_table, optarg,
|
||||
&werrflags)) {
|
||||
PERROR("%s: Invalid --Werror option %s\n",
|
||||
|
|
Loading…
Add table
Reference in a new issue