Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Jun 2010 17:59:20 GMT
From:      Benjamin Fiedler <bfiedler@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 179367 for review
Message-ID:  <201006091759.o59HxK1v025780@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@179367?ac=10

Change 179367 by bfiedler@freebsd-home on 2010/06/09 17:58:44

	Fix --help options

Affected files ...

.. //depot/projects/soc2010/bsdtextproc/diff/diff.c#3 edit

Differences ...

==== //depot/projects/soc2010/bsdtextproc/diff/diff.c#3 (text+ko) ====

@@ -139,13 +139,15 @@
 	{ NULL,				0,			NULL,	'\0'}
 };
 
-static const char* help_msg[] = { 
+static const char *help_msg[] = { 
 "-a --text  treat files as ASCII text",
 "-B --ignore-blank-lines  Ignore blank newlines in the comparison",
 "-b --ignore-space-change  Ignore all changes due to whitespace",
 "-C NUM --context=[NUM]  Show NUM lines before and after change (default 3)",
 "-D --ifdef=NAME",
-NULL };
+NULL,
+};
+char **help_strs = (char **)help_msg;
 
 
 void usage(void);
@@ -293,6 +295,12 @@
 			ignore_file_case = 0;
 			break; 
 		case OPT_HELP:
+			for(;*help_strs;help_strs++) 
+			{
+				printf("%s\n", *help_strs);
+			}
+			exit(2);
+			break;
 		default:
 			usage();
 			break;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006091759.o59HxK1v025780>