.ds Vv 1.2.14 .TH VistaIOReportBadArgs 3 "24 April 1993" "VistaIO Version \*(Vv" .SH NAME VistaIOReportBadArgs \- report unrecognized command line arguments .SH SYNOPSIS .nf .ft B #include .PP .ft B void VistaIOReportBadArgs (\fIargc\fP, \fIargv\fP) .RS int \fIargc\fP; char *\fIargv\fP; .fi .SH ARGUMENTS .IP \fIargc\fP Specifies the number of unrecognized command line arguments. .IP \fIargv\fP Specifies a vector of unrecognized command line arguments. .SH DESCRIPTION \fBVistaIOReportBadArgs\fP is usually called after \fBVistaIOParseCommand\fP has indicated a problem parsing command line arguments. It prints a message listing those arguments that \fBVistaIOParseCommand\fP could not comprehend. .PP \fBVistaIOParseCommand\fP leaves the program name and any unrecognized arguments in the first \fIargc\fP entries of the \fIargv\fP vector. \fBVistaIOReportBadArgs\fP finds them there: it assumes that \fIargv\fP[0] contains the program's name, and that \fIargv\fP[1] through \fIargv\fP[\fIargc\fP\ \-\ 1] are the arguments that could not be parsed. The message it prints to the standard error stream is of the form: .PP .RS \fIprogram\fB: Unrecognized arguments: \fIarg1 arg2\fR ... .RE .PP where \fIprogram\fP is the first element of \fIargv\fP and \fIarg1\fP, \fIarg2\fP, etc. are the remaining elements. .SH EXAMPLES The following code fragment parses command line arguments using \fBVistaIOParseCommand\fP. Any arguments not recognized by \fBVistaIOParseCommand\fP are then parsed by some other means (e.g., by \fBXtDisplayInitialize\fP(3Xt)). Finally, if any arguments remain, having not been recognized during either parsing, they are printed along with information on the valid program options. .PP .nf .B "#include " .PP .B "static VistaIOOptionDescRec options[] = { /* option table entries */ };" .PP .ft B int main (int argc, char *argv) { .RS if (! VistaIOParseCommand (VistaIONumber (options), options, & argc, argv)) .RS goto Usage; .RE .PP Parse arguments remaining in argv[1] ... argv[argc - 1]. .PP .ft B if (argc > 1) { .RS VistaIOReportBadArgs (argc, argv); .RE .RE Usage: .RS .RS VistaIOReportUsage (argv[0], VistaIONumber (options), options, NULL); fprintf (stderr, " plus any X Windows options.\\n\\n"); exit (1); .RE } .PP \&... .PP .RE .B } .fi .SH "SEE ALSO" .na .nh .BR VistaIOParseCommand (3), .BR VistaIOReportUsage (3), .BR VistaIOoption (3), .ad .hy .SH AUTHOR Art Pope Adaption to vistaio: Gert Wollny