diff --git a/src/Makefile.am b/src/Makefile.am index 44c8f542..a6992b45 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,4 @@ -# $Id: Makefile.am,v 1.36 2005/10/05 09:48:12 rocky Exp $ +# $Id: Makefile.am,v 1.37 2005/10/06 09:37:11 rocky Exp $ # # Copyright (C) 2003, 2004, 2005 Rocky Bernstein # @@ -16,8 +16,11 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # + +EXTRA_DIST = iso-info.help2man cd-info.help2man cd-drive.help2man + #################################################### -# Things to make the sample/test programs +# Things to make the utility/diagnostic programs #################################################### if BUILD_CD_PARANOIA @@ -31,7 +34,7 @@ if MAINTAINER_MODE MAINTAINERCLEANFILES = $(man_MANS) man_MANS = cd-drive.1 cd-info.1 cd-read.1 iso-read.1 iso-info.1 $(man_MANS): %.1: % - -$(HELP2MAN) --output=$@ ./$< + -$(HELP2MAN) --opt-include=$<.help2man --no-info --output=$@ ./$< endif if BUILD_CDDA_PLAYER diff --git a/src/cd-drive.c b/src/cd-drive.c index d495671c..98464b25 100644 --- a/src/cd-drive.c +++ b/src/cd-drive.c @@ -1,5 +1,5 @@ /* - $Id: cd-drive.c,v 1.24 2005/10/05 09:48:12 rocky Exp $ + $Id: cd-drive.c,v 1.25 2005/10/06 09:37:11 rocky Exp $ Copyright (C) 2004, 2005 Rocky Bernstein @@ -125,9 +125,9 @@ parse_options (int argc, char *argv[]) break; case '?': - fprintf(stderr, helpText, program_name); + fprintf(stdout, helpText, program_name); free(program_name); - exit(EXIT_FAILURE); + exit(EXIT_INFO); break; case OP_USAGE: diff --git a/src/cd-drive.help2man b/src/cd-drive.help2man new file mode 100644 index 00000000..961dfa2b --- /dev/null +++ b/src/cd-drive.help2man @@ -0,0 +1,7 @@ +[SYNOPSIS] +.B cd-drive +\fIOPTION\fR... +.TP +Shows CD-ROM drive characteristics. +[SEE ALSO] +\&\f(CWcd-info(1)\fR for information about the CD inside a CD-ROM. diff --git a/src/cd-info.c b/src/cd-info.c index 93a83a78..5cec70df 100644 --- a/src/cd-info.c +++ b/src/cd-info.c @@ -1,5 +1,5 @@ /* - $Id: cd-info.c,v 1.145 2005/10/05 09:48:12 rocky Exp $ + $Id: cd-info.c,v 1.146 2005/10/06 09:37:11 rocky Exp $ Copyright (C) 2003, 2004, 2005 Rocky Bernstein Copyright (C) 1996, 1997, 1998 Gerd Knorr @@ -326,9 +326,9 @@ parse_options (int argc, char *argv[]) case 'V': opts.version_only = 1; break; case '?': - fprintf(stderr, helpText, program_name); + fprintf(stdout, helpText, program_name); free(program_name); - exit(EXIT_FAILURE); + exit(EXIT_INFO); break; case OP_USAGE: @@ -369,7 +369,7 @@ parse_options (int argc, char *argv[]) } } - if (NULL == source_name) { + if (NULL == source_name && !opts.version_only) { report(stderr, "%s: No source specified.\n", program_name); free(program_name); exit (EXIT_FAILURE); diff --git a/src/cd-info.help2man b/src/cd-info.help2man new file mode 100644 index 00000000..4d4206ac --- /dev/null +++ b/src/cd-info.help2man @@ -0,0 +1,8 @@ +[SYNOPSIS] +.B cd-info +\fIOPTION\fR... +.TP +Shows Information about a CD or CD-image. +[SEE ALSO] +\&\f(CWcd-drive(1)\fR for CD-ROM characteristics; +\&\f(CWiso-info(1)\fR for information about an ISO-9660 image. diff --git a/src/iso-info.c b/src/iso-info.c index 081e2abe..b27f819f 100644 --- a/src/iso-info.c +++ b/src/iso-info.c @@ -1,5 +1,5 @@ /* - $Id: iso-info.c,v 1.31 2005/10/05 09:48:12 rocky Exp $ + $Id: iso-info.c,v 1.32 2005/10/06 09:37:11 rocky Exp $ Copyright (C) 2004, 2005 Rocky Bernstein @@ -150,9 +150,9 @@ parse_options (int argc, char *argv[]) case 'V': opts.version_only = 1; break; case '?': - fprintf(stderr, helpText, program_name); + fprintf(stdout, helpText, program_name); free(program_name); - exit(EXIT_FAILURE); + exit(EXIT_INFO); break; case OP_USAGE: diff --git a/src/iso-info.help2man b/src/iso-info.help2man new file mode 100644 index 00000000..7b98bac4 --- /dev/null +++ b/src/iso-info.help2man @@ -0,0 +1,8 @@ +[SYNOPSIS] +.B iso-info +\fIOPTION\fR... +.TP +Shows Information about an ISO 9660 image. +[SEE ALSO] +\&\f(CWcd-info(1)\fR for information about an ISO-9660 image. +\&\f(CWcd-read(1)\fR to read portions of an ISO 9660 image. diff --git a/src/util.c b/src/util.c index 44fe6a67..15a94116 100644 --- a/src/util.c +++ b/src/util.c @@ -1,5 +1,5 @@ /* - $Id: util.c,v 1.50 2005/09/15 06:36:01 rocky Exp $ + $Id: util.c,v 1.51 2005/10/06 09:37:11 rocky Exp $ Copyright (C) 2003, 2004, 2005 Rocky Bernstein @@ -71,7 +71,7 @@ PARTICULAR PURPOSE.\n\ else report( stdout, "No CD-ROM device found.\n"); free(program_name); - exit(100); + exit(EXIT_INFO); } } diff --git a/src/util.h b/src/util.h index 568445ac..43e7ba3e 100644 --- a/src/util.h +++ b/src/util.h @@ -1,5 +1,5 @@ /* - $Id: util.h,v 1.13 2005/10/05 09:48:12 rocky Exp $ + $Id: util.h,v 1.14 2005/10/06 09:37:11 rocky Exp $ Copyright (C) 2003, 2004, 2005 Rocky Bernstein @@ -74,6 +74,10 @@ # define EXIT_SUCCESS 0 #endif +#ifndef EXIT_INFO +# define EXIT_INFO 100 +#endif + #define DEBUG 1 #if DEBUG #define dbg_print(level, s, args...) \