/* -*- C -*- * ARGS.C * * (c)Copyright 1995 by Tobias Ferber, All Rights Reserved * * This file is part of ADOC. * * ADOC is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published * by the Free Software Foundation; either version 1 of the License, * or (at your option) any later version. * * ADOC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $VER: $Id: args.c,v 1.1.1.1 2001/07/18 11:05:53 root Exp $ */ #include #include static char *howtouse[]= { "-", "--stdin", "", "read source code from stdin", "-0", "--no-output", "", "do not write any output (same as `-n')", "-1", "--autodoc", "", "create autodoc output (default)", "-2", "--texinfo", "", "create texinfo output", "-2", "--texi", "", "", "-b", "--texi-funtable", "", "create a @table for each function", "-B", "--body-environment", "", "put body text into a @ environment", /* "-Bexample", "--example", "", "put body text into an @example environment", "-Bsmallexample", "--small-example", "", "put body text into a @smallexample environment", "-Bsmallexample", "--smallexample", "", "", "-Bdisplay", "--display", "", "put body text into a @display environment", */ "-c", "--flip-slashes", "", "convert \\* to /* and *\\ to */", "-c", "--convert", "", "", #ifdef DEBUG "-d", "--debug", "", "set debug level to ", #endif "-D", "", "", "define a texinfo header macro", "-DPROJECT", "--project", "", "define a value for the PROJECT macro", "-DEDITION", "--edition", "", "define a value for the EDITION macro", "-DREVISION", "--revision", "", "define a value for the REVISION macro", "-DCOPYRIGHT", "--copyright", "", "define a value for the COPYRIGHT macro", "-DAUTHOR", "--author", "", "define a value for the AUTHOR macro", "-E", "--error-file", "", "redirect error messages (default is stderr)", "-f", "--no-form-feeds", "", "no form feeds (^L) or @page between entries", "-f", "--no-ff", "", "", "-ff", "--form-feeds", "", "begin a new page for each function", "-g", "--no-grouping", "", "no creation of @group ... @end group", "-g", "--no-groups", "", "", "-gs", "--group-sections", "", "put keyword sections into a @group", "-H", "--texi-header-file", "", "read texinfo header from file ", "-h", "--help", "", "print this short usage information and exit", "-i", "--internal", "", "process only internal docs (same as `-yi')", "-I", "--table-of-contents", "", "output table of contents before entries", "-I", "--toc", "", "", "-j", "--reindent-bodytext", "", "change the indentation of bodytext lines", "-j", "--reindent", "", "", "-l", "--line-length", "", "set autodoc page width to columns", "-l", "--page-width", "", "", "-l", "--width", "", "", "-l", "--columns", "", "", "-l", "--cols", "", "", "-M", "", "", "define a body text macro", "-n", "--dry-run", "", "do not write any output (same as `-0')", "-n", "--dryrun", "", "", "-o", "--output-file", "", "set output filename (default is stdout)", "-p", "--preserve-order", "", "don't sort autodoc entries", "-p", "--no-sort", "", "", "-pp", "--sort-entries", "", "sort autodoc entries (default)", "-q", "--quiet", "", "don't print information while processing", "-q", "--silent", "", "", "-q", "--brief", "", "", "-t", "--tabs-to-spaces", "", "turn tabs to spaces (same as `-T8')", "-T", "--tab-size", "", "set tab step to columns", "-T", "--tabsize", "", "", "-U", "", "", "undefine a macro defined via `-D' or `-M'", /* "-u", "--unindent-bodytext", "", "remove indentation of body text lines", "-u", "--unindent", "", "", */ "-uu", "--preserve-indent", "", "do not modify the body text indentation", "-uu", "--preserve-indentation", "", "", "-v", "--version", "", "print author and version information", "-W", "--no-warnings", "", "don't print any warnings", "-Wkeywords", "--check-keywords", "", "check section keywords while reading", "-Wabsence", "--check-presence", "", "look for missing section keywords", "-Wall", "--pedantic", "", "complain about almost everything", "-x", "--no-references", "", "print the SEE ALSO section as it is", "-xoff", "--no-xrefs", "", "", "-xon", "--parse-references", "", "try to create @xref{}s from SEE ALSO", "-xitemize", "--itemize-references", "", "put @xref{}s into an @itemize list", "-y", "--yank-type", "", "process only comments of type ", "-y", "--input-type", "", "", "-y", "--comment-type", "", "", "-Y", "--indented-comments", "", "allow an indentation of autodoc comments", "-Y", "--allow-indentation", "", "", "-z", "--no-texi-header", "", "ommit writing texinfo header and title page", "-Z", "--no-texi-index", "", "ommit function index and table of contents", #if 0 /* * The following options are ignored for compatibility * with Bill Koester's original version `autodoc' which * is part of C=ommodore's Native Developer Kit (NDK). */ "-C", "--slash-asterisk", "", "process autodocs starting with /*", "-s", "--semicolon", "", "process autodocs starting with a semicolon", "-a", "--asterisk", "", "process autodocs starting with an asterisk", "-F", "--tempfile", "", "ignored for compatibility", "-r", "--troff", "", "ignored for compatibility", "-w", "--no-word-wrap", "", "ignored for compatibility", #endif /*0*/ (char *)0, (char *)0, (char *)0, (char *)0 }; char * convert_args(char *s) { char **t= howtouse; while(*t) { if(!strcmp(s,t[1])) break; t= &t[4]; } return (*t) ? *t : s; } void display_args(int which) { char **t= howtouse; while(*t) { if(t[3] && *t[3]) { if(which & 1) { printf("%-12s ",t[0]); if(which & 2) printf("%s ",t[1][0] ? "or":" "); } if(which & 2) printf("%-20s ",t[1][0] ? t[1] : ((which & 1) ? "": t[0]) ); if(which & 3) printf("%-13s %s\n",t[2],t[3]); } t= &t[4]; } }