2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-31 06:16:03 +00:00

parser: fix collision of --config-file and --compile-features options

Unfortunately both --config-file and --compile-features are using
139 to indicate the feature which breaks one or the other depending
on how the switch state that processes the options is compiled.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/173
Acked-by: Seth Arnold <seth.arnold@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
(cherry picked from commit 3da52f7515)
This commit is contained in:
John Johansen
2018-08-15 13:31:11 -07:00
parent a17775b821
commit e0f7594c73

View File

@@ -159,7 +159,7 @@ struct option long_options[] = {
{"jobs", 1, 0, 'j'},
{"max-jobs", 1, 0, 136}, /* no short option */
{"print-cache-dir", 0, 0, 137}, /* no short option */
{"config-file", 1, 0, 139}, /* early option, no short option */
{"config-file", 1, 0, 141}, /* early option, no short option */
{"print-config-file", 0, 0, 140}, /* no short option */
{NULL, 0, 0, 0},
};
@@ -613,7 +613,7 @@ static int process_arg(int c, char *optarg, int config_count)
kernel_load = 0;
print_cache_dir = true;
break;
case 139:
case 141:
if (optind - config_count != 1) {
PERROR("%s: --config-file=%s must be the first option specified\n", progname, optarg);
exit(1);