socsvn commit: r237104 - in soc2012/jhagewood: diff3 diff3/diff3 mdocml

jhagewood at FreeBSD.org jhagewood at FreeBSD.org
Tue Jun 5 00:06:48 UTC 2012


Author: jhagewood
Date: Tue Jun  5 00:06:45 2012
New Revision: 237104
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=237104

Log:

Modified:
  soc2012/jhagewood/diff3/diff3/diff3prog.c
  soc2012/jhagewood/diff3/hagewood-diff3.patch
  soc2012/jhagewood/mdocml/hagewood-mdocml.patch

Modified: soc2012/jhagewood/diff3/diff3/diff3prog.c
==============================================================================
--- soc2012/jhagewood/diff3/diff3/diff3prog.c	Mon Jun  4 23:29:06 2012	(r237103)
+++ soc2012/jhagewood/diff3/diff3/diff3prog.c	Tue Jun  5 00:06:45 2012	(r237104)
@@ -151,7 +151,9 @@
 __dead void edscript(int);
 __dead void trouble(void);
 void increase(void);
-__dead void usage(void);
+__dead void try_help(void);
+void help(void);
+void usage(void);
 
 enum {  
         HELP_OPT = CHAR_MAX + 1,
@@ -167,6 +169,7 @@
 	{ "initial-tab",	no_argument,		NULL,	'T' },
 	{ "text",		no_argument,		NULL,	'a' },
 	{ "version",		no_argument,		NULL,	'v' },
+	{ "help",		no_argument,		NULL,	128 },	
 	
 	/* features to implement */
 	{ "show-all",		no_argument,		NULL,	'A' },
@@ -176,7 +179,7 @@
 	{ "strip-trailing-cr",	no_argument,		NULL,	STRIPCR_OPT },
 	{ "diff-program",	required_argument,	NULL,	DIFFPROG_OPT },
 
-	{ "help",		no_argument,		NULL,	HELP_OPT }
+
 };
 
 
@@ -226,6 +229,10 @@
 		case '3':
 			eflag = 2;
 			break;
+		case 128:
+			usage();
+			help();
+			exit(0);
 		case STRIPCR_OPT:
 			strip_cr = 1;
 			break;
@@ -237,8 +244,10 @@
 	argc -= optind;
 	argv += optind;
 	/* XXX - argc usage seems wrong here */
-	if (argc < 5)
+	if (argc < 5) {
 		usage();
+		try_help();
+	}
 
 	if (oflag) {
 		(void)snprintf(f1mark, sizeof(f1mark), "<<<<<<< %s",
@@ -703,13 +712,39 @@
 }
 
 
-__dead void
+__dead void 
+try_help(void)
+{
+	fprintf(stderr, "diff3: Try `diff3 --help' for more information.");
+	exit(EXIT_FAILURE);
+}
+
+void 
+help(void)
+{
+	printf ("%s", "\
+	-e  --ed  Output unmerged changes from OLDFILE to YOURFILE into MYFILE.\n\
+	-A  --show-all  Output all changes, bracketing conflicts.\n\
+	-x  --overlap-only  Output overlapping changes.\n\
+	-3  --easy-only  Output unmerged nonoverlapping changes.\n\n");
+	printf ("%s", "\
+	-m  --merge  Output merged file instead of ed script (default -A).\n\
+	-L LABEL  --label=LABEL  Use LABEL instead of file name.\n\
+	-a  --text  Treat all files as text.\n\
+	-T  --initial-tab  Make tabs line up by prepending a tab.\n\n");
+	printf ("%s", "\
+	-v  --version  Output version info.\n\
+	--help  Output this help.\n\n");
+	printf ("If a FILE is `-', read standard input.\n");
+	
+}
+
+void
 usage(void)
 {
 	extern char *__progname;
 
 	fprintf(stderr, "usage: %s [-exEX3] /tmp/d3a.?????????? "
 	    "/tmp/d3b.?????????? file1 file2 file3\n", __progname);
-	fprintf(stderr, "diff3: Try `diff3 --help' for more information.");
-	exit(EXIT_FAILURE);
+	    
 }

Modified: soc2012/jhagewood/diff3/hagewood-diff3.patch
==============================================================================
--- soc2012/jhagewood/diff3/hagewood-diff3.patch	Mon Jun  4 23:29:06 2012	(r237103)
+++ soc2012/jhagewood/diff3/hagewood-diff3.patch	Tue Jun  5 00:06:45 2012	(r237104)
@@ -1,26 +1,40 @@
-diff -rupN diff3-orig/diff3prog.c diff3/diff3prog.c
---- diff3-orig/diff3prog.c	2012-06-01 05:35:13.000000000 -0400
-+++ diff3/diff3prog.c	2012-06-04 23:23:50.000000000 -0400
-@@ -166,7 +166,8 @@ static struct option longopts[] = {
+diff -rupN jhagewood/diff3/diff3-orig/diff3prog.c jhagewood/diff3/diff3/diff3prog.c
+--- jhagewood/diff3/diff3-orig/diff3prog.c	2012-06-04 23:30:11.000000000 -0400
++++ jhagewood/diff3/diff3/diff3prog.c	2012-06-05 00:06:08.000000000 -0400
+@@ -151,7 +151,9 @@ void separate(const char *);
+ __dead void edscript(int);
+ __dead void trouble(void);
+ void increase(void);
+-__dead void usage(void);
++__dead void try_help(void);
++void help(void);
++void usage(void);
+ 
+ enum {  
+         HELP_OPT = CHAR_MAX + 1,
+@@ -166,7 +168,9 @@ static struct option longopts[] = {
  	{ "overlap-only",	no_argument,		NULL,	'x' },
  	{ "initial-tab",	no_argument,		NULL,	'T' },
  	{ "text",		no_argument,		NULL,	'a' },
 -
 +	{ "version",		no_argument,		NULL,	'v' },
++	{ "help",		no_argument,		NULL,	128 },	
 +	
  	/* features to implement */
  	{ "show-all",		no_argument,		NULL,	'A' },
  	{ "easy-only", 		no_argument,		NULL,	'3' },
-@@ -174,7 +175,7 @@ static struct option longopts[] = {
+@@ -174,8 +178,8 @@ static struct option longopts[] = {
  	{ "label",		required_argument,	NULL,	'L' },
  	{ "strip-trailing-cr",	no_argument,		NULL,	STRIPCR_OPT },
  	{ "diff-program",	required_argument,	NULL,	DIFFPROG_OPT },
 -	{ "version",		no_argument,		NULL,	'v' },
+-	{ "help",		no_argument,		NULL,	HELP_OPT }
++
 +
- 	{ "help",		no_argument,		NULL,	HELP_OPT }
  };
  
-@@ -216,6 +217,9 @@ main(int argc, char **argv)
+ 
+@@ -216,12 +220,19 @@ main(int argc, char **argv)
  		case 'X':
  			oflag = eflag = 1;
  			break;
@@ -30,10 +44,67 @@
  		case 'x':
  			eflag = 1;
  			break;
-@@ -706,5 +710,6 @@ usage(void)
+ 		case '3':
+ 			eflag = 2;
+ 			break;
++		case 128:
++			usage();
++			help();
++			exit(0);
+ 		case STRIPCR_OPT:
+ 			strip_cr = 1;
+ 			break;
+@@ -233,8 +244,10 @@ main(int argc, char **argv)
+ 	argc -= optind;
+ 	argv += optind;
+ 	/* XXX - argc usage seems wrong here */
+-	if (argc < 5)
++	if (argc < 5) {
+ 		usage();
++		try_help();
++	}
+ 
+ 	if (oflag) {
+ 		(void)snprintf(f1mark, sizeof(f1mark), "<<<<<<< %s",
+@@ -699,12 +712,39 @@ increase(void)
+ }
+ 
+ 
+-__dead void
++__dead void 
++try_help(void)
++{
++	fprintf(stderr, "diff3: Try `diff3 --help' for more information.");
++	exit(EXIT_FAILURE);
++}
++
++void 
++help(void)
++{
++	printf ("%s", "\
++	-e  --ed  Output unmerged changes from OLDFILE to YOURFILE into MYFILE.\n\
++	-A  --show-all  Output all changes, bracketing conflicts.\n\
++	-x  --overlap-only  Output overlapping changes.\n\
++	-3  --easy-only  Output unmerged nonoverlapping changes.\n\n");
++	printf ("%s", "\
++	-m  --merge  Output merged file instead of ed script (default -A).\n\
++	-L LABEL  --label=LABEL  Use LABEL instead of file name.\n\
++	-a  --text  Treat all files as text.\n\
++	-T  --initial-tab  Make tabs line up by prepending a tab.\n\n");
++	printf ("%s", "\
++	-v  --version  Output version info.\n\
++	--help  Output this help.\n\n");
++	printf ("If a FILE is `-', read standard input.\n");
++	
++}
++
++void
+ usage(void)
+ {
+ 	extern char *__progname;
  
  	fprintf(stderr, "usage: %s [-exEX3] /tmp/d3a.?????????? "
  	    "/tmp/d3b.?????????? file1 file2 file3\n", __progname);
-+	fprintf(stderr, "diff3: Try `diff3 --help' for more information.");
- 	exit(EXIT_FAILURE);
+-	exit(EXIT_FAILURE);
++	    
  }

Modified: soc2012/jhagewood/mdocml/hagewood-mdocml.patch
==============================================================================
--- soc2012/jhagewood/mdocml/hagewood-mdocml.patch	Mon Jun  4 23:29:06 2012	(r237103)
+++ soc2012/jhagewood/mdocml/hagewood-mdocml.patch	Tue Jun  5 00:06:45 2012	(r237104)
@@ -1,6 +1,6 @@
 diff -rupN jhagewood/mdocml/mdocml-1.12.1-orig/man.h jhagewood/mdocml/mdocml-1.12.1/man.h
---- jhagewood/mdocml/mdocml-1.12.1-orig/man.h	2012-06-01 05:35:15.000000000 -0400
-+++ jhagewood/mdocml/mdocml-1.12.1/man.h	2012-06-04 04:47:34.000000000 -0400
+--- jhagewood/mdocml/mdocml-1.12.1-orig/man.h	2012-06-04 23:30:13.000000000 -0400
++++ jhagewood/mdocml/mdocml-1.12.1/man.h	2012-06-04 23:30:15.000000000 -0400
 @@ -43,6 +43,8 @@ enum	mant {
  	MAN_sp,
  	MAN_nf,
@@ -11,8 +11,8 @@
  	MAN_RS,
  	MAN_DT,
 diff -rupN jhagewood/mdocml/mdocml-1.12.1-orig/man_term.c jhagewood/mdocml/mdocml-1.12.1/man_term.c
---- jhagewood/mdocml/mdocml-1.12.1-orig/man_term.c	2012-06-01 05:35:15.000000000 -0400
-+++ jhagewood/mdocml/mdocml-1.12.1/man_term.c	2012-06-04 05:04:08.000000000 -0400
+--- jhagewood/mdocml/mdocml-1.12.1-orig/man_term.c	2012-06-04 23:30:13.000000000 -0400
++++ jhagewood/mdocml/mdocml-1.12.1/man_term.c	2012-06-04 23:30:15.000000000 -0400
 @@ -82,6 +82,8 @@ static	int		  pre_alternate(DECL_ARGS);
  static	int		  pre_ft(DECL_ARGS);
  static	int		  pre_ign(DECL_ARGS);


More information about the svn-soc-all mailing list