[PATCH] iptables-restore: renames --test to --dry-run

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

The following patch renames the option --test (-t) to --dry-run (-d)
in order to free the letter 't' for --table, which makes the options
more consistent regarding the other *tables tools, where -t is always
--table.

peter

--- patch begins here ---
renames --test (-t) to --dry-run (-d) and -T (--table) to -t
adds missing short options to usage message

Signed-off-by: Peter Warasin <peter@xxxxxxxxxx>
---
Index: iptables-restore.c
===================================================================
--- iptables-restore.c.orig	2007-11-07 21:57:45.000000000 +0100
+++ iptables-restore.c	2007-11-07 22:09:12.000000000 +0100
@@ -29,11 +29,11 @@
 	{ "binary", 0, 0, 'b' },
 	{ "counters", 0, 0, 'c' },
 	{ "verbose", 0, 0, 'v' },
-	{ "test", 0, 0, 't' },
+	{ "dry-run", 0, 0, 'd' },
 	{ "help", 0, 0, 'h' },
 	{ "noflush", 0, 0, 'n'},
 	{ "modprobe", 1, 0, 'M'},
-	{ "table", 1, 0, 'T'},
+	{ "table", 1, 0, 't'},
 	{ 0 }
 };

@@ -41,11 +41,11 @@

 static void print_usage(const char *name, const char *version)
 {
-	fprintf(stderr, "Usage: %s [-b] [-c] [-v] [-t] [-h]\n"
+	fprintf(stderr, "Usage: %s [-b] [-c] [-v] [-d] [-h] [-n] [-t] [-M]\n"
 			"	   [ --binary ]\n"
 			"	   [ --counters ]\n"
 			"	   [ --verbose ]\n"
-			"	   [ --test ]\n"
+			"	   [ --dry-run ]\n"
 			"	   [ --help ]\n"
 			"	   [ --noflush ]\n"
 			"	   [ --table=<TABLE> ]\n"
@@ -139,7 +139,7 @@
 	init_extensions();
 #endif

-	while ((c = getopt_long(argc, argv, "bcvthnM:T:", options, NULL)) != -1) {
+	while ((c = getopt_long(argc, argv, "bcvdhnM:t:", options, NULL)) != -1) {
 		switch (c) {
 			case 'b':
 				binary = 1;
@@ -150,7 +150,7 @@
 			case 'v':
 				verbose = 1;
 				break;
-			case 't':
+			case 'd':
 				testing = 1;
 				break;
 			case 'h':
@@ -163,7 +163,7 @@
 			case 'M':
 				modprobe = optarg;
 				break;
-			case 'T':
+			case 't':
 				tablename = optarg;
 				break;
 		}

-
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux