Improve manual pages.

* help output needs to be to stdout not stderr for help2man (*.c,*.h)
* Add EXIT_INFO return code.  (*.c,*.h)
* Start filling out man pages, e.g. add SEE ALSO. *.help2man
* Remove non-existent reference to Info pages Makefile.am
This commit is contained in:
rocky
2005-10-06 09:37:11 +00:00
parent 37bb687ed2
commit e660ebfe7a
9 changed files with 46 additions and 16 deletions

View File

@@ -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 <rocky@panix.com> # Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
# #
@@ -16,8 +16,11 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # 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 if BUILD_CD_PARANOIA
@@ -31,7 +34,7 @@ if MAINTAINER_MODE
MAINTAINERCLEANFILES = $(man_MANS) MAINTAINERCLEANFILES = $(man_MANS)
man_MANS = cd-drive.1 cd-info.1 cd-read.1 iso-read.1 iso-info.1 man_MANS = cd-drive.1 cd-info.1 cd-read.1 iso-read.1 iso-info.1
$(man_MANS): %.1: % $(man_MANS): %.1: %
-$(HELP2MAN) --output=$@ ./$< -$(HELP2MAN) --opt-include=$<.help2man --no-info --output=$@ ./$<
endif endif
if BUILD_CDDA_PLAYER if BUILD_CDDA_PLAYER

View File

@@ -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 <rocky@panix.com> Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -125,9 +125,9 @@ parse_options (int argc, char *argv[])
break; break;
case '?': case '?':
fprintf(stderr, helpText, program_name); fprintf(stdout, helpText, program_name);
free(program_name); free(program_name);
exit(EXIT_FAILURE); exit(EXIT_INFO);
break; break;
case OP_USAGE: case OP_USAGE:

7
src/cd-drive.help2man Normal file
View File

@@ -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.

View File

@@ -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 <rocky@panix.com> Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
Copyright (C) 1996, 1997, 1998 Gerd Knorr <kraxel@bytesex.org> Copyright (C) 1996, 1997, 1998 Gerd Knorr <kraxel@bytesex.org>
@@ -326,9 +326,9 @@ parse_options (int argc, char *argv[])
case 'V': opts.version_only = 1; break; case 'V': opts.version_only = 1; break;
case '?': case '?':
fprintf(stderr, helpText, program_name); fprintf(stdout, helpText, program_name);
free(program_name); free(program_name);
exit(EXIT_FAILURE); exit(EXIT_INFO);
break; break;
case OP_USAGE: 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); report(stderr, "%s: No source specified.\n", program_name);
free(program_name); free(program_name);
exit (EXIT_FAILURE); exit (EXIT_FAILURE);

8
src/cd-info.help2man Normal file
View File

@@ -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.

View File

@@ -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 <rocky@panix.com> Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -150,9 +150,9 @@ parse_options (int argc, char *argv[])
case 'V': opts.version_only = 1; break; case 'V': opts.version_only = 1; break;
case '?': case '?':
fprintf(stderr, helpText, program_name); fprintf(stdout, helpText, program_name);
free(program_name); free(program_name);
exit(EXIT_FAILURE); exit(EXIT_INFO);
break; break;
case OP_USAGE: case OP_USAGE:

8
src/iso-info.help2man Normal file
View File

@@ -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.

View File

@@ -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 <rocky@panix.com> Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -71,7 +71,7 @@ PARTICULAR PURPOSE.\n\
else else
report( stdout, "No CD-ROM device found.\n"); report( stdout, "No CD-ROM device found.\n");
free(program_name); free(program_name);
exit(100); exit(EXIT_INFO);
} }
} }

View File

@@ -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 <rocky@panix.com> Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -74,6 +74,10 @@
# define EXIT_SUCCESS 0 # define EXIT_SUCCESS 0
#endif #endif
#ifndef EXIT_INFO
# define EXIT_INFO 100
#endif
#define DEBUG 1 #define DEBUG 1
#if DEBUG #if DEBUG
#define dbg_print(level, s, args...) \ #define dbg_print(level, s, args...) \