When compiled static, don't show help-messages for all matches and targets,
only show help for specified ones.
diff --git a/iptables.c b/iptables.c
index bec912f..648f988 100644
--- a/iptables.c
+++ b/iptables.c
@@ -346,9 +346,9 @@
 }
 
 void
-exit_printhelp(void)
+exit_printhelp(struct iptables_rule_match *matches)
 {
-	struct iptables_match *m = NULL;
+	struct iptables_rule_match *matchp = NULL;
 	struct iptables_target *t = NULL;
 
 	printf("%s v%s\n\n"
@@ -413,14 +413,16 @@
 
 	/* Print out any special helps. A user might like to be able
 	   to add a --help to the commandline, and see expected
-	   results. So we call help for all matches & targets */
-	for (t=iptables_targets;t;t=t->next) {
-		printf("\n");
-		t->help();
+	   results. So we call help for all specified matches & targets */
+	for (t = iptables_targets; t ;t = t->next) {
+		if (t->used) {
+			printf("\n");
+			t->help();
+		}
 	}
-	for (m=iptables_matches;m;m=m->next) {
+	for (matchp = matches; matchp; matchp = matchp->next) {
 		printf("\n");
-		m->help();
+		matchp->match->help();
 	}
 	exit(0);
 }
@@ -1836,10 +1838,10 @@
 				optarg = argv[optind];
 
 			/* iptables -p icmp -h */
-			if (!iptables_matches && protocol)
-				find_match(protocol, TRY_LOAD, NULL);
+			if (!matches && protocol)
+				find_match(protocol, TRY_LOAD, &matches);
 
-			exit_printhelp();
+			exit_printhelp(matches);
 
 			/*
 			 * Option selection