Skip to contentSkip to conversation

main: restore --debug

PATCH New Pablo Neira Ayuso 1 participant 1 message Jan 9, 2020 netfilter

lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 main: restore --debug

Broken since options are mandatory before commands.

Fixes fb9cea50e8b3 ("main: enforce options before commands")
---
 src/main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
src/main.c +4 -2
index 74199f93fa66..6ab1b89f4dd5 100644
@@ -46,7 +46,7 @@ enum opt_vals {
 	OPT_TERSE		= 't',
 	OPT_INVALID		= '?',
 };
-#define OPTSTRING	"+hvcf:iI:jvnsNaeSupypTt"
+#define OPTSTRING	"+hvd:cf:iI:jvnsNaeSupypTt"
 
 static const struct option options[] = {
 	{
@@ -228,8 +228,10 @@ static bool nft_options_check(int argc, char * const argv[])
 			if (nonoption) {
 				nft_options_error(argc, argv, pos);
 				return false;
-			} else if (argv[i][1] == 'I' ||
+			} else if (argv[i][1] == 'd' ||
+				   argv[i][1] == 'I' ||
 				   argv[i][1] == 'f' ||
+				   !strcmp(argv[i], "--debug") ||
 				   !strcmp(argv[i], "--includepath") ||
 				   !strcmp(argv[i], "--file")) {
 				skip = true;
Signature · 1 line
2.11.0