diff --git a/doc/ngspice.texi b/doc/ngspice.texi index ea0edb18f..c1698a2aa 100644 --- a/doc/ngspice.texi +++ b/doc/ngspice.texi @@ -6239,15 +6239,46 @@ Clear the value of the specified variable(s) (word). General Form: @example - version [version id] + version [-s | -f | ] @end example -Print out the version of nutmeg that is running. If there are -arguments, it checks to make sure that the arguments match the current -version of NGSPICE. (This is mainly used as a Command: line in rawfiles.) +Print out the version of @emph{nutmeg} that is running, if invoked without argument +or with @code{-s} or @code{-f}. If the argument is a @code{} (any string different +from @code{-s} or @code{-f} is considered a @code{} ), the command checks to make +sure that the arguments match the current version of NGSPICE. +(This is mainly used as a @code{Command:} line in rawfiles.) +@emph{Options description} +@itemize @bullet +@item No option: The output of the command is the message you can see when running NGSPICE + from the command line, no more no less. +@item @code{-s}(hort): A shorter version of the message you see when calling NGSPICE from the + command line. +@item @code{-f}(ull): You may want to use this option if you want to know what extensions + are included into the simulator and what compilation switches are + active. A list of compilation options and included extensions is + appended to the normal (not short) message. May be useful when sending + bug reports. +@end itemize + +The following example shows what the command returns is some situations: + +@example +ngspice 10 -> version +****** +** ngspice-15 : Circuit level simulation program +** The U. C. Berkeley CAD Group +** Copyright 1985-1994, Regents of the University of California. +** Please submit bug-reports to: ngspice-devel@@lists.sourceforge.net +** Creation Date: Sun Aug 24 00:35:57 CEST 2003 +****** +ngspice 11 -> version 14 +Note: rawfile is version 14 (current version is 15) +ngspice 12 -> version 15 +ngspice 13 -> +@end example @node Where, Write, Version, Commands @subsection Where: Identify troublesome node or device diff --git a/src/frontend/misccoms.c b/src/frontend/misccoms.c index 09fc0e7ed..de3e16d9c 100644 --- a/src/frontend/misccoms.c +++ b/src/frontend/misccoms.c @@ -156,7 +156,7 @@ com_version(wordlist *wl) } else { s = wl_flatten(wl); - if (!strncmp(s, "-s", 2)) { + if (!strncmp(s, "-s", 2) || !strncmp(s, "-S", 2) ) { fprintf(cp_out, "******\n"); fprintf(cp_out, "** %s-%s\n", ft_sim->simulator, ft_sim->version); @@ -165,6 +165,63 @@ com_version(wordlist *wl) if (Spice_Build_Date && *Spice_Build_Date) fprintf(cp_out, "** Creation Date: %s\n", Spice_Build_Date); fprintf(cp_out, "******\n"); + } else if (!strncmp(s, "-f", 2) || !strncmp(s, "-F", 2) ) { + + fprintf(cp_out, "******\n"); + + fprintf(cp_out, "** %s-%s : %s\n", ft_sim->simulator, + ft_sim->version, ft_sim->description); + fprintf(cp_out, "** The U. C. Berkeley CAD Group\n"); + fprintf(cp_out, + "** Copyright 1985-1994, Regents of the University of California.\n"); + if (Spice_Notice && *Spice_Notice) + fprintf(cp_out, "** %s\n", Spice_Notice); + if (Spice_Build_Date && *Spice_Build_Date) + fprintf(cp_out, "** Creation Date: %s\n", Spice_Build_Date); + fprintf(cp_out,"**\n"); +#ifdef CIDER + fprintf(cp_out,"** CIDER 1.b1 (CODECS simulator) included\n"); +#endif +#ifdef XSPICE + fprintf(cp_out,"** XSPICE extensions included\n"); +#endif + fprintf(cp_out,"** Relevant compilation options (refer to user's manual):\n"); +#ifdef NOBYPASS + fprintf(cp_out,"** --enable-nobypass\n"); +#endif +#ifdef CAPBYPASS + fprintf(cp_out,"** --enable-capbypass\n"); +#endif +#ifdef CAPZEROBYPASS + fprintf(cp_out,"** --enable-capzerobypass\n"); +#endif +#ifdef NODELIMITING + fprintf(cp_out,"** --enable-nodelimiting\n"); +#endif +#ifdef PREDICTOR + fprintf(cp_out,"** --enable-predictor\n"); +#endif +#ifdef NEWTRUNC + fprintf(cp_out,"** --enable-newtrunc\n"); +#endif +#ifdef NOSQRT + fprintf(cp_out,"** --enable-nosqrt\n"); +#endif +#ifdef INT_NOISE + fprintf(cp_out,"** --enable-intnoise\n"); +#endif +#ifdef WANT_SENSE2 + fprintf(cp_out,"** --enable-sense2\n"); +#endif + fprintf(cp_out,"**\n"); +#ifdef EXPERIMENTAL_CODE + fprintf(cp_out,"** Experimental code enabled.\n"); +#endif +#ifdef EXP_DEV + fprintf(cp_out,"** Experimental devices enabled.\n"); +#endif + fprintf(cp_out, "******\n"); + } else if (!eq(ft_sim->version, s)) { fprintf(stderr, "Note: rawfile is version %s (current version is %s)\n",