/* Generated by docgen/gen_minihelp.py from manual/ngspice_manual.html.
   DO NOT EDIT.  Regenerate instead:
     python3 docgen/gen_minihelp.py manual/ngspice_manual.html \
             --c src/frontend/minihelp_gen.c
   Provides:  const char *minihelp_lookup(const char *cmd);
   Returns the mini-help text for a command name (case-insensitive),
   or NULL if there is none. */
#include <stdlib.h>
#include <string.h>
#include <strings.h>

const char *minihelp_lookup(const char *cmd);

struct minihelp_ent { const char *key; const char *text; };

static const char mh_0[] =
    ".ac  —  small-signal AC (frequency) analysis   [batch + ui]\n"
    "\n"
    "Synopsis:\n"
    "  .ac  dec|oct|lin  n  fstart  fstop\n"
    "\n"
    "Linearizes the circuit about its DC operating point and sweeps frequency,\n"
    "giving complex node voltages (magnitude/phase). Stimulus comes from sources\n"
    "carrying an AC value.\n"
    "\n"
    "See also: .noise, .tf, .op.\n"
    "\n";

static const char mh_1[] =
    "A  —  XSPICE code models   [batch + ui]\n"
    "also: codemodel\n"
    "\n"
    "Synopsis:\n"
    "  Aname  in-ports …  out-ports …  modelname\n"
    "  .model modelname  codemodel_type ( params )\n"
    "  codemodel  library.cm                 $ load an external code-model library\n"
    "\n"
    "The A card instantiates an XSPICE code model — a compiled behavioral block\n"
    "(gain, summer, limiter, s-domain transfer function, ADC/DAC, a file-driven\n"
    "source, …) beyond the built-in analog primitives. The code models are not\n"
    "linked into ngspice; they live in shared-library files (analog.cm,\n"
    "digital.cm, xtradev.cm, …) and are loaded at run time by the codemodel\n"
    "command. In a normal install spinit already issues those codemodel lines at\n"
    "start-up (guarded by $?xspice_enabled), so a deck can use gain, filesource,\n"
    "etc. with no codemodel line of its own.\n"
    "\n"
    "See also: .model, .spiceinit (where codemodel normally lives), OSDI\n"
    "(compiled foundry passives, a different route).\n"
    "\n";

static const char mh_2[] =
    "alias  —  command shortcuts   [ui only]\n"
    "also: unalias\n"
    "\n"
    "Synopsis:\n"
    "  alias [ name [ definition ] ]        unalias name\n"
    "\n"
    "Defines a control-mode shortcut for a command and its arguments. alias with\n"
    "no arguments lists all aliases; unalias removes one.\n"
    "\n"
    "See also: define.\n"
    "\n";

static const char mh_3[] =
    "alter  —  change a device value between runs   [batch + ui]\n"
    "\n"
    "Synopsis:\n"
    "  alter  devname  value\n"
    "  alter  devname  param = value\n"
    "\n"
    "Changes an instance parameter of an already-loaded device (a resistance,\n"
    "capacitance, source level, …) without editing or re-parsing the netlist.\n"
    "Follow it with run to resimulate. Ideal inside a foreach/while loop for\n"
    "parameter studies.\n"
    "\n"
    "See also: altermod, foreach, @dev[param], .param.\n"
    "\n";

static const char mh_4[] =
    "altermod  —  change a model parameter between runs   [batch + ui]\n"
    "\n"
    "Synopsis:\n"
    "  altermod  modelname  param = value\n"
    "\n"
    "Like alter, but targets a .model parameter — the change affects every device\n"
    "using that model. Useful for corner/temperature what-ifs.\n"
    "\n"
    "See also: alter.\n"
    "\n";

static const char mh_5[] =
    "@device[param]  —  read a device/model parameter   [ui only]\n"
    "\n"
    "Synopsis:\n"
    "  @devicename[parameter]        $ e.g. @R1[resistance], @M1[gm], @Q1[ic]\n"
    "\n"
    "The @ accessor reads a live device (or model) parameter or operating-point\n"
    "quantity into an expression — resistance of a resistor, gm/vds of a MOSFET,\n"
    "ic of a BJT, etc. It must be evaluated (via let/print), not echoed. Which\n"
    "parameters exist for a device is listed by devhelp / showmod.\n"
    "\n"
    "See also: let, devhelp, alter.\n"
    "\n";

static const char mh_6[] =
    "compose  —  build a vector   [ui only]\n"
    "\n"
    "Synopsis:\n"
    "  compose  name  values v1 v2 …\n"
    "  compose  name  start=a stop=b step=d      (or  lin=n / log=n)\n"
    "\n"
    "Creates a vector from an explicit list of values, or as a linear/log ramp.\n"
    "Handy for building a sweep axis or a lookup table inside .control.\n"
    "\n"
    "See also: let.\n"
    "\n";

static const char mh_7[] =
    ".csparam  —  expose a parameter to .control   [batch + ui]\n"
    "\n"
    "Synopsis:\n"
    "  .csparam  name = { expression }\n"
    "\n"
    "Copies a netlist parameter into the .control namespace (as a vector), where\n"
    "plain .param values are otherwise invisible. The bridge between parse-time\n"
    "parameters and the control script.\n"
    "\n"
    "See also: .param, set, let.\n"
    "\n";

static const char mh_8[] =
    ".dc  —  DC sweep   [batch + ui]\n"
    "\n"
    "Synopsis:\n"
    "  .dc  srcname  start  stop  step  [ srcname2 start2 stop2 step2 ]\n"
    "\n"
    "Sweeps a source (voltage or current) — or a nested pair of sources — and\n"
    "records the DC solution at each step, producing curves vs. the swept value.\n"
    "The classic use is a device I–V characteristic.\n"
    "\n"
    "See also: .op, .tran.\n"
    "\n";

static const char mh_9[] =
    "define  —  user functions   [ui only]\n"
    "\n"
    "Synopsis:\n"
    "  define  name(args)  expression\n"
    "\n"
    "Defines a reusable function of one or more arguments, usable anywhere an\n"
    "expression is (in let, print, plotting). Handy for repeated post-processing\n"
    "(dB, RMS, a custom figure of merit).\n"
    "\n"
    "See also: let.\n"
    "\n";

static const char mh_10[] =
    "devhelp  —  device & model introspection   [batch + ui]\n"
    "also: devices, show, showmod\n"
    "\n"
    "Synopsis:\n"
    "  devhelp [ devtype [ param ] ]      $ list a device type's parameters\n"
    "  devices [ regexp … ]               $ list device instance NAMES only\n"
    "  show    device|regexp … [ : param … ]   $ instance operating-point values\n"
    "  showmod model|regexp … [ : param … ]    $ model parameter values\n"
    "\n"
    "devhelp lists what parameters a device type accepts and reports;\n"
    "show/showmod print the live values for instances/models after a run — the\n"
    "readable companion to the @dev[param] accessor.\n"
    "\n"
    "See also: @dev[param], .model, display.\n"
    "\n";

static const char mh_11[] =
    "diff  —  compare two plots   [ui only]\n"
    "\n"
    "Synopsis:\n"
    "  diff  plot1  plot2  [ vec … ]\n"
    "\n"
    "Compares two saved plots vector by vector and reports only the entries that\n"
    "differ by more than the tolerances (set diff_abstol/diff_reltol/diff_vntol).\n"
    "The quick way to see what a parameter change actually moved.\n"
    "\n"
    "See also: setplot, alter, display.\n"
    "\n";

static const char mh_12[] =
    "display  —  list vectors in the current plot   [ui only]\n"
    "\n"
    "Synopsis:\n"
    "  display [ name | keyword | regexp … ]\n"
    "\n"
    "Shows the status (not the values) of the vectors in the current plot: each\n"
    "line is name : type, real/complex, length, with the scale tagged [default\n"
    "scale]. The quickest way to see what a run produced or what an analysis\n"
    "created (e.g. the sensitivity vectors of .sens). For the numbers use print;\n"
    "for a waveform, plot. It reports the current plot only — setplot first to\n"
    "inspect another.\n"
    "\n"
    "See also: setplot, print, plot, let.\n"
    "\n";

static const char mh_13[] =
    ".disto  —  small-signal distortion analysis   [batch + ui]\n"
    "\n"
    "Synopsis:\n"
    "  .disto  dec|oct|lin  n  fstart fstop  [ f2overf1 ]\n"
    "\n"
    "Computes steady-state harmonic (and, with f2overf1, intermodulation)\n"
    "distortion from the device small-signal series. Stimulus comes from sources\n"
    "carrying a DISTOF1/DISTOF2 spec. Results land in two plots: disto1\n"
    "(2nd-order) and disto2 (3rd-order); the node vectors are the distortion\n"
    "products.\n"
    "\n"
    "See also: .four, .ac, setplot.\n"
    "\n";

static const char mh_14[] =
    "echo  —  print text   [ui only]\n"
    "\n"
    "Synopsis:\n"
    "  echo [ stuff … ]\n"
    "\n"
    "Prints its arguments, expanding shell variables ($var). It does not evaluate\n"
    "vectors or expressions — use $&vec for a vector’s value, or print for\n"
    "expressions.\n"
    "\n"
    "See also: print, set.\n"
    "\n";

static const char mh_15[] =
    "fft  —  FFT of a transient vector   [ui only]\n"
    "\n"
    "Synopsis:\n"
    "  fft  vector …\n"
    "\n"
    "After a .tran run, computes the FFT of each vector into a new spectrum plot\n"
    "(frequency resolution = 1/timespan). Use mag()/db() on the complex result. A\n"
    "windowed, more controllable alternative to .four; window via set\n"
    "specwindow=….\n"
    "\n"
    "See also: .four, spec, meas.\n"
    "\n";

static const char mh_16[] =
    "fopen  —  read a file line by line   [ui only]\n"
    "also: fread, fclose\n"
    "\n"
    "Synopsis:\n"
    "  fopen  handle file [mode]     $ open; handle name in $handle-var\n"
    "  fread  handle var [len]       $ read a line into $var; status in $len-var\n"
    "  fclose handle\n"
    "\n"
    "Line-oriented file reading for .control scripts (parameter tables, external\n"
    "stimuli).\n"
    "\n";

static const char mh_17[] =
    "foreach  —  iterate over a word list   [ui only]\n"
    "\n"
    "Synopsis:\n"
    "  foreach  var  word1 word2 …\n"
    "    … body (use $var) …\n"
    "  end\n"
    "\n"
    "Runs the body once per word, with var set to each word in turn (words are\n"
    "literal text — values, node names, filenames). The most common way to repeat\n"
    "a run over a set of parameter values.\n"
    "\n"
    "See also: while, repeat, .dc.\n"
    "\n";

static const char mh_18[] =
    ".four  —  Fourier analysis of a transient   [batch + ui]\n"
    "also: fourier\n"
    "\n"
    "Synopsis:\n"
    "  .four  freq  output_variable ...\n"
    "\n"
    "After a .tran run, computes the DC component, fundamental (at freq), and\n"
    "harmonics 2–9 of each output, plus total harmonic distortion (THD). Operates\n"
    "on the last period of the transient waveform.\n"
    "\n"
    "See also: .tran, fft, spec.\n"
    "\n";

static const char mh_19[] =
    ".global  —  global nodes   [batch + ui]\n"
    "\n"
    "Synopsis:\n"
    "  .global  node …\n"
    "\n"
    "Declares nodes that are the same net everywhere — reachable inside any\n"
    "subcircuit without being wired through its ports. The usual candidates are\n"
    "supplies and the substrate (vdd, gnd, vss). Ground node 0 is always global.\n"
    "\n"
    "See also: .subckt.\n"
    "\n";

static const char mh_20[] =
    "goto  —  control-flow jump   [ui only]\n"
    "also: label\n"
    "\n"
    "Synopsis:\n"
    "  label name        goto name\n"
    "\n"
    "An unstructured jump within a .control block. Prefer the structured loops\n"
    "(foreach/while/repeat); goto is for the occasional escape or a small state\n"
    "machine.\n"
    "\n"
    "See also: while, foreach.\n"
    "\n";

static const char mh_21[] =
    ".ic  —  initial node conditions   [batch + ui]\n"
    "also: .nodeset\n"
    "\n"
    "Synopsis:\n"
    "  .ic       v(node) = value …      $ forced initial value (with .tran uic)\n"
    "  .nodeset  v(node) = value …      $ hint for the DC operating-point solver\n"
    "\n"
    ".ic forces a node to a value at the start of a transient run when the\n"
    "analysis uses uic. .nodeset only seeds the DC solver (to pick between\n"
    "multiple solutions or aid convergence) and is released once DC converges —\n"
    "it does not force a transient start value.\n"
    "\n"
    "See also: .tran (uic), .op.\n"
    "\n";

static const char mh_22[] =
    ".if  —  conditional netlist   [batch + ui]\n"
    "also: .elseif, .else, .endif\n"
    "\n"
    "Synopsis:\n"
    "  .if(expr)\n"
    "    … cards …\n"
    "  .elseif(expr)\n"
    "    … cards …\n"
    "  .else\n"
    "    … cards …\n"
    "  .endif\n"
    "\n"
    "Includes netlist cards conditionally at parse time, based on a parameter\n"
    "expression — corners, options, or variant topologies selected from one deck.\n"
    "\n"
    "See also: .param, foreach.\n"
    "\n";

static const char mh_23[] =
    ".include  —  pull in other files   [batch + ui]\n"
    "also: .lib\n"
    "\n"
    "Synopsis:\n"
    "  .include  filename\n"
    "  .lib      filename  section\n"
    "\n"
    ".include textually inserts another file (parameters, subcircuits, models).\n"
    ".lib file section pulls only a named section — the standard way PDKs ship\n"
    "process corners.\n"
    "\n"
    "See also: .param, .ic, .temp. Related structural cards not yet detailed:\n"
    ".global, .option, .csparam, .model.\n"
    "\n";

static const char mh_24[] =
    "let  —  vectors and expressions   [ui only]\n"
    "also: print\n"
    "\n"
    "Synopsis:\n"
    "  let  name = expression      $ create/assign a vector\n"
    "  print  expression …         $ evaluate and show\n"
    "\n"
    "let creates or overwrites a vector from an expression over existing vectors\n"
    "and constants; print evaluates any expression (arithmetic, node voltages\n"
    "v(n), branch currents i(vs), functions). Operators include + - * /, % (mod),\n"
    "comparisons, and many functions (sqrt, abs, db, …).\n"
    "\n"
    "See also: set, define, @dev[param].\n"
    "\n";

static const char mh_25[] =
    "linearize  —  resample onto a uniform time grid   [ui only]\n"
    "\n"
    "Synopsis:\n"
    "  linearize [ vec … ]\n"
    "\n"
    "A transient runs on an adaptive timestep, so its samples are unevenly\n"
    "spaced. linearize interpolates the vectors onto a uniform grid (step = the\n"
    ".tran tstep). Required before operations that assume even spacing — notably\n"
    "fft — and handy for exporting clean columns with wrdata.\n"
    "\n"
    "See also: fft, wrdata.\n"
    "\n";

static const char mh_26[] =
    "listing  —  show the parsed circuit   [ui only]\n"
    "\n"
    "Synopsis:\n"
    "  listing [ logical | physical | deck | expand | runnable ]\n"
    "\n"
    "Prints the current circuit as ngspice sees it after parsing — useful to\n"
    "confirm parameter substitution, subcircuit expansion (expand), or the exact\n"
    "runnable deck (runnable).\n"
    "\n"
    "See also: source, edit.\n"
    "\n";

static const char mh_27[] =
    "load  —  read a raw file back   [ui only]\n"
    "\n"
    "Synopsis:\n"
    "  load [ rawfile … ]\n"
    "\n"
    "Reads a raw file (from -r or write) into a new plot, so an earlier run’s\n"
    "data can be re-examined, compared, or post-processed without re-simulating.\n"
    "\n"
    "See also: write, setplot.\n"
    "\n";

static const char mh_28[] =
    ".meas  —  extract figures of merit   [batch + ui]\n"
    "also: meas\n"
    "\n"
    "Synopsis:\n"
    "  .meas  analysis  result  FIND expr  AT=t | WHEN expr=val\n"
    "  .meas  analysis  result  MAX|MIN|AVG|RMS|PP|INTEG  expr  [FROM=t TO=t]\n"
    "  .meas  analysis  result  TRIG expr VAL=a RISE=n  TARG expr VAL=b RISE=n\n"
    "  .meas  analysis  result  PARAM='expr'\n"
    "\n"
    "ngspice’s measurement command — the analog of SPICE .measure / Eldo\n"
    ".EXTRACT. It reduces an analysis result to a named scalar you can print,\n"
    "reuse in a later .meas, or feed to a script: peak/trough (MAX/MIN),\n"
    "average/RMS/peak-to-peak/integral over a window, a value at a time or when a\n"
    "condition holds (FIND … AT/WHEN), and delays/rise-times (TRIG … TARG).\n"
    "\n"
    "See also: .tran, print, .four.\n"
    "\n";

static const char mh_29[] =
    ".model  —  named device model   [batch + ui]\n"
    "\n"
    "Synopsis:\n"
    "  .model  name  type ( param=value … )\n"
    "\n"
    "Defines a named parameter set shared by every instance that references it.\n"
    "The instance card names the model in its model position (e.g. D1 a k\n"
    "MYDIODE).\n"
    "\n"
    "See also: altermod (change a model at runtime), OSDI.\n"
    "\n";

static const char mh_30[] =
    ".noise  —  noise analysis   [batch + ui]\n"
    "\n"
    "Synopsis:\n"
    "  .noise  v(output [,ref])  input_source  dec|oct|lin  n  fstart  fstop  [ pts_per_summary ]\n"
    "\n"
    "Computes output-referred and input-referred noise spectral density vs.\n"
    "frequency (vectors onoise_spectrum, inoise_spectrum), and their integrals\n"
    "over the band (scalars onoise_total, inoise_total, in V and V/√Hz-integrated\n"
    "→ V rms).\n"
    "\n"
    "See also: .ac.\n"
    "\n";

static const char mh_31[] =
    ".op  —  DC operating point   [batch + ui]\n"
    "\n"
    "Synopsis:\n"
    "  .op\n"
    "\n"
    "Solves the quiescent DC bias: all capacitors open, all inductors shorted,\n"
    "sources at their DC value. Prints every node voltage and source current, and\n"
    "(in interactive mode) makes the small-signal device operating-point\n"
    "parameters available. It is the starting point of .tran (unless uic) and\n"
    ".ac.\n"
    "\n"
    "See also: .dc, .tf, .tran.\n"
    "\n";

static const char mh_32[] =
    ".option  —  simulator options   [batch + ui]\n"
    "also: .options\n"
    "\n"
    "Synopsis:\n"
    "  .option  name[=value] …\n"
    "\n"
    "Sets tolerances, temperature, integration method, and output behavior. The\n"
    "most common:\n"
    "\n"
    "  reltol [1e-3] - relative convergence/LTE tolerance\n"
    "  abstol / vntol [1e-12 / 1e-6] - absolute current / voltage tolerance\n"
    "  trtol / chgtol [7 / 1e-14] - transient LTE / charge tolerance (see the\n"
    "    accuracy note)\n"
    "  temp / tnom [27 / 27] - analysis / nominal temperature (°C)\n"
    "  method [trap] - integration: trap or gear\n"
    "  bypass [0] - device-eval bypass — leave off for precision analog\n"
    "  savecurrents [off] - store branch currents (readable as @dev[i])\n"
    "  numdgt [6] - digits in printed output\n"
    "  itl1 / itl2 [100 / 50] - Newton iteration limit for the DC operating point\n"
    "    / the DC transfer curve\n"
    "  itl4 [10] - Newton iteration limit at one transient timepoint; exceeding\n"
    "    it cuts the timestep\n"
    "  maxiterfloor [100] - lower bound the solver forces on itl1/itl2/itl4 — set\n"
    "    to 0 to have them obeyed (see below)\n"
    "  minres [0 (off)] - parasitic reduction: short resistors below this value\n"
    "    by merging their two nodes (ground and source terminals are protected)\n"
    "  mincap [0 (off)] - parasitic reduction: delete capacitors below this value\n"
    "  gmin [1e-12 S] - conductance added across every nonlinear device junction\n"
    "    (the classic SPICE convergence aid)\n"
    "  floatgmin [1e-12 S] - conductance tying floating (fewer than two\n"
    "    terminals) nodes to ground; =0 disables\n"
    "  rshunt [off] - resistance from every node to ground — a blunt instrument;\n"
    "    see the gotcha below\n"
    "  pstran / dptran [off] - last-resort pseudo-transient continuation for an\n"
    "    operating point that Newton and the fallback methods cannot reach; see\n"
    "    below\n"
    "\n"
    "See also: .temp, @dev[param], accuracy note.\n"
    "\n";

static const char mh_33[] =
    "Other commands  —  less-common, alias & developer   [reference]\n"
    "\n"
    "See also: set, stop (breakpoints), osdi.\n"
    "\n";

static const char mh_34[] =
    ".param  —  parameters and functions   [batch + ui]\n"
    "also: .func\n"
    "\n"
    "Synopsis:\n"
    "  .param  name = value   [ name2 = expr … ]\n"
    "  .func   name(args) = { expression }\n"
    "\n"
    ".param defines named constants (usable in any value via {name}); .func\n"
    "defines a parameter-time function. Both are resolved during parsing — they\n"
    "cannot see simulation results (for that, use let/define in .control).\n"
    "\n"
    "See also: .subckt, let, define.\n"
    "\n";

static const char mh_35[] =
    ".plot  —  a curve, ASCII or graphical   [batch + ui]\n"
    "also: plot\n"
    "\n"
    "Synopsis:\n"
    "  .plot  analysis  expr ...          $ batch: ASCII line plot\n"
    "  plot   expr ... [ vs xexpr ]       $ control mode: graphical window\n"
    "  plot   \"regexp\" ...                $ plot every matching vector\n"
    "\n"
    "See also: .print, wrdata, gnuplot.\n"
    "\n";

static const char mh_36[] =
    "print  —  values as text   [batch + ui]\n"
    "also: .print\n"
    "\n"
    "Synopsis:\n"
    "  print  expr ...                    $ control mode: dump values to stdout\n"
    "  print  \"regexp\" ...                $ control mode: values of all matching vectors\n"
    "  .print  analysis  expr ...         $ batch: a formatted table\n"
    "\n"
    "Control-mode print writes the value of vectors/expressions to the console (a\n"
    "scalar prints on one line; a vector prints all points). The dot-card .print\n"
    "tran|ac|dc … produces a numbered table of the named vectors after the run —\n"
    "and is one of the output directives that make an analysis actually run in\n"
    "batch mode.\n"
    "\n"
    "See also: .plot, wrdata, display.\n"
    "\n";

static const char mh_37[] =
    ".pz  —  pole–zero analysis   [batch + ui]\n"
    "\n"
    "Synopsis:\n"
    "  .pz  node1 node2 node3 node4  cur|vol  pz|pol|zer\n"
    "\n"
    "Finds the poles and/or zeros of a small-signal transfer function about the\n"
    "DC operating point. node1 node2 are the input port, node3 node4 the output\n"
    "port; vol (voltage transfer) or cur (transimpedance); pz = both, pol = poles\n"
    "only, zer = zeros only. Results appear as complex vectors pole(k), zero(k)\n"
    "(rad/s).\n"
    "\n"
    "See also: .ac, .tf.\n"
    "\n";

static const char mh_38[] =
    "repeat  —  fixed count & branching   [ui only]\n"
    "also: if, else\n"
    "\n"
    "Synopsis:\n"
    "  repeat [ n ]        if condition        break / continue\n"
    "    … body …            … body …          (exit / skip a loop pass)\n"
    "  end                 else\n"
    "                        … body …\n"
    "                      end\n"
    "\n"
    "See also: while, foreach.\n"
    "\n";

static const char mh_39[] =
    "reset  —  session commands   [batch + ui]\n"
    "also: rehash, help, quit\n"
    "\n"
    "Synopsis:\n"
    "  reset      $ re-setup the circuit to its just-parsed state\n"
    "  rehash     $ rebuild the executable-command hash\n"
    "  help [subject]     quit     bug     tutorial\n"
    "\n"
    "reset restores the circuit to its initial state, undoing alters and prior\n"
    "runs; help browses the built-in docs; quit exits; bug shows the bug-report\n"
    "address; tutorial points at the tutorials.\n"
    "\n"
    "See also: alter, source.\n"
    "\n";

static const char mh_40[] =
    "reshape  —  vector surgery   [ui only]\n"
    "also: transpose, cutout, cross\n"
    "\n"
    "Synopsis:\n"
    "  reshape   vec …  [dim1,dim2,…]   $ change a vector's dimensions\n"
    "  transpose var …                  $ transpose a multi-dimensional vector\n"
    "  cutout    vec …                  $ keep only the current scale range\n"
    "  cross     newvec index vec …     $ build a vector from one index across others\n"
    "\n"
    "Manipulate the shape/contents of data vectors — reshape a flat vector into a\n"
    "matrix, transpose it, trim to a window, or gather a cross-section. Mostly\n"
    "for post-processing multi-dimensional (e.g. swept) results.\n"
    "\n"
    "See also: compose, let.\n"
    "\n";

static const char mh_41[] =
    ".save  —  choose what is stored   [batch + ui]\n"
    "also: save\n"
    "\n"
    "Without any .save, a -r run stores the default set: every node voltage and\n"
    "every voltage-source current. A .save (or control-mode save) replaces that\n"
    "with exactly the vectors you name, always alongside the time/frequency\n"
    "scale. Use it to shrink large raw files, or to store an expression such as a\n"
    "differential voltage.\n"
    "\n";

static const char mh_42[] =
    ".sens  —  sensitivity analysis   [batch + ui]\n"
    "\n"
    "Synopsis:\n"
    "  .sens  output_variable                        $ DC sensitivity\n"
    "  .sens  output_variable  ac  dec n fstart fstop  $ AC sensitivity\n"
    "\n"
    "Computes the sensitivity of an output to every circuit element and model\n"
    "parameter, at the DC operating point (or over frequency with the ac form).\n"
    "Results land in a Sensitivity Analysis plot: the bare element name (e.g. r1)\n"
    "is d(output)/d(element value), and elem:param (e.g. r1:tc1) breaks it down\n"
    "per model parameter.\n"
    "\n"
    "See also: .tf, .op, .ac.\n"
    "\n";

static const char mh_43[] =
    "set  —  shell variables vs. vector values   [ui only]\n"
    "also: $, $&\n"
    "\n"
    "Synopsis:\n"
    "  set name = value          $ define a shell variable\n"
    "  $name                     $ expand a shell variable (text)\n"
    "  $&vecname                 $ expand the numeric value of a vector\n"
    "\n"
    "set makes a shell variable (a string/flag, e.g. set appendwrite). $name\n"
    "substitutes its text. To drop a vector’s numeric value into a command line\n"
    "(e.g. an echo or a filename), use $&vecname — the & is what says “take the\n"
    "value of the vector”, not “look up a shell variable”.\n"
    "\n"
    "See also: let, foreach / while, .spiceinit.\n"
    "\n";

static const char mh_44[] =
    "setplot  —  manage plots   [ui only]\n"
    "also: setscale, destroy\n"
    "\n"
    "Synopsis:\n"
    "  setplot [ plotname ]     $ list plots / switch the current one\n"
    "  setscale [ vecname ]     $ set the default scale of the current plot\n"
    "  destroy [ plotname … ]   $ free a plot's data (or 'all')\n"
    "\n"
    "Each run/analysis makes a new plot (a named vector set: tran1, ac1, sens1,\n"
    "…) — so the plot list is your list of completed simulations. setplot with no\n"
    "argument lists them, marks the current, and shows each one’s analysis type\n"
    "and title (and interactively prompts you to pick one); with a name it\n"
    "switches. Cross-plot references use plot.vector (e.g. ac1.inp). destroy\n"
    "reclaims memory.\n"
    "\n"
    "See also: display, reset.\n"
    "\n";

static const char mh_45[] =
    "setseed  —  seed the random generator   [ui only]\n"
    "\n"
    "Synopsis:\n"
    "  setseed  integer\n"
    "\n"
    "Fixes the seed of the random generator used by agauss/gauss/unif and\n"
    "Monte-Carlo draws, so a randomized run is exactly reproducible — set the\n"
    "same seed before each run to repeat a sequence.\n"
    "\n"
    "See also: mc_source, .option.\n"
    "\n";

static const char mh_46[] =
    "settype  —  set a vector's type/units   [ui only]\n"
    "\n"
    "Synopsis:\n"
    "  settype  type  vec | regexp …     $ type = voltage | current | time | frequency | impedance | …\n"
    "\n"
    "Relabels a computed vector’s physical type so plots and printouts carry the\n"
    "correct axis label and units (a derived impedance, power, gain, …). A vector\n"
    "argument containing regex metacharacters retypes every current-plot vector\n"
    "whose name matches — e.g. settype impedance .*#branch (same regex selection\n"
    "as display).\n"
    "\n"
    "See also: let, display.\n"
    "\n";

static const char mh_47[] =
    "shell  —  OS shell & directory   [ui only]\n"
    "also: cd, getcwd\n"
    "\n"
    "Synopsis:\n"
    "  shell [ command ]     cd [ dir ]     getcwd\n"
    "\n"
    "shell runs an OS command (or forks an interactive shell); cd/getcwd change\n"
    "and print the working directory. Handy for pre/post-processing around a run.\n"
    "\n";

static const char mh_48[] =
    "snsave  —  save/restore simulation state   [ui only]\n"
    "also: snload\n"
    "\n"
    "Synopsis:\n"
    "  snsave file      snload file\n"
    "\n"
    "Writes (or reloads) a full simulator snapshot — node values and internal\n"
    "state — so a long run can be checkpointed and continued later, or a hard-won\n"
    "operating point reused as a starting condition.\n"
    "\n"
    "See also: .ic.\n"
    "\n";

static const char mh_49[] =
    "source  —  load a deck interactively   [ui only]\n"
    "also: edit\n"
    "\n"
    "Synopsis:\n"
    "  source  file        edit [ file ]\n"
    "\n"
    "source reads and loads another netlist file into the running session; edit\n"
    "opens the current (or a named) deck in $EDITOR and reloads it on exit.\n"
    "Interactive workflow aids; use .include for static composition.\n"
    "\n"
    "See also: listing, .include.\n"
    "\n";

static const char mh_50[] =
    ".sp  —  RF & large-signal analyses   [batch + ui]\n"
    "also: .pss, .hb\n"
    "\n"
    "Synopsis:\n"
    "  .sp   dec|lin n fstart fstop     $ S-parameters (needs P RF-port elements)\n"
    "  .pss  fund tstop points …        $ periodic steady state (shooting method)\n"
    "  .hb   fund nharm                 $ harmonic balance\n"
    "\n"
    ".sp computes scattering parameters and requires P RF-port elements (each\n"
    "with a reference impedance) on the ports of interest. .pss (periodic steady\n"
    "state) and .hb (harmonic balance) are large-signal RF analyses for finding a\n"
    "circuit’s steady periodic response directly.\n"
    "\n"
    "See also: .ac, .tf.\n"
    "\n";

static const char mh_51[] =
    "spec  —  spectrum over a frequency range   [ui only]\n"
    "\n"
    "Synopsis:\n"
    "  spec  fstart  fstop  fstep  vector …\n"
    "\n"
    "Like fft, but computes the spectrum at the exact frequencies you name\n"
    "(fstart…fstop by fstep), rather than the FFT’s fixed 1/timespan bins. Run\n"
    "linearize first.\n"
    "\n"
    "See also: fft, .four, linearize.\n"
    "\n";

static const char mh_52[] =
    ".step  —  not supported\n"
    "\n"
    "See also: foreach, alter, .dc (built-in sweeps).\n"
    "\n";

static const char mh_53[] =
    "stop  —  breakpoints   [batch + ui]\n"
    "also: resume, delete\n"
    "\n"
    "Synopsis:\n"
    "  stop [ after n ] [ when expr ] …    $ set a breakpoint / condition\n"
    "  resume                              $ continue a stopped run\n"
    "  delete [ all | number … ]           $ remove breakpoints\n"
    "\n"
    "Pause a transient at a time, iteration, or condition to inspect state, then\n"
    "resume. Most useful interactively (or when driven from a script that\n"
    "examines vectors at each stop).\n"
    "\n"
    "See also: .tran.\n"
    "\n";

static const char mh_54[] =
    "strcmp  —  string operations   [ui only]\n"
    "also: strstr, strslice\n"
    "\n"
    "Synopsis:\n"
    "  strcmp   var s1 s2            $ var = C strcmp(s1,s2): 0 if equal\n"
    "  strstr   var s1 s2            $ var = index of s2 in s1 (-1 if absent)\n"
    "  strslice var s1 offset len    $ var = s1[offset .. offset+len)\n"
    "\n"
    "Each sets a shell variable from a string operation, for scripting file\n"
    "names, labels, and conditionals in .control.\n"
    "\n"
    "See also: set, echo.\n"
    "\n";

static const char mh_55[] =
    ".subckt  —  subcircuits   [batch + ui]\n"
    "also: .ends, X\n"
    "\n"
    "Synopsis:\n"
    "  .subckt  name  node1 node2 …  [ param=default … ]\n"
    "    … elements …\n"
    "  .ends\n"
    "  Xname  net1 net2 …  name  [ param=value … ]      $ instantiation\n"
    "\n"
    "A subcircuit is a reusable block with external ports and optional\n"
    "parameters. Instantiate it with an X card, wiring your nets to its ports and\n"
    "overriding parameters by name. Internal nodes are addressed hierarchically\n"
    "as Xinstance.node (e.g. v(x1.mid) above).\n"
    "\n"
    "See also: .param, .include, .ac, meas.\n"
    "\n";

static const char mh_56[] =
    ".temp  —  simulation temperature   [batch + ui]\n"
    "\n"
    "Synopsis:\n"
    "  .temp  value_in_celsius        $ or, in .control:  set temp = value\n"
    "\n"
    "Sets the analysis temperature (°C). Every temperature-dependent model\n"
    "(diode/BJT/MOS saturation currents, resistor tc1/tc2, …) is re-evaluated. In\n"
    ".control you can change set temp between runs to sweep temperature.\n"
    "\n"
    "See also: altermod, .op.\n"
    "\n";

static const char mh_57[] =
    ".tf  —  DC small-signal transfer function   [batch + ui]\n"
    "\n"
    "Synopsis:\n"
    "  .tf  output_variable  input_source\n"
    "\n"
    "Computes, at the DC operating point, the small-signal ratio output/input,\n"
    "the resistance seen at the input source, and the resistance seen at the\n"
    "output. One command for gain and both port impedances.\n"
    "\n"
    "See also: .op, .ac.\n"
    "\n";

static const char mh_58[] =
    ".tran  —  transient analysis   [batch + ui]\n"
    "\n"
    "Synopsis:\n"
    "  .tran  tstep  tstop  [ tstart  [ tmax ] ]  [ uic ]\n"
    "\n"
    "Computes the circuit response in the time domain from tstart (default 0) to\n"
    "tstop. tstep is the printing/initial step; the actual internal step is\n"
    "chosen adaptively by local-truncation-error control and never exceeds tmax\n"
    "(default (tstop−tstart)/50). Results are stored in the current plot as\n"
    "vectors indexed by the time scale.\n"
    "\n"
    "See also: .save (restrict what is stored), .ic/.nodeset, control-mode tran,\n"
    "meas.\n"
    "\n";

static const char mh_59[] =
    "unlet  —  delete vectors   [ui only]\n"
    "\n"
    "Synopsis:\n"
    "  unlet  vecname | regexp …\n"
    "\n"
    "Removes vectors from the current plot (frees memory, or drops intermediates\n"
    "before a write). The inverse of let. An argument containing regex\n"
    "metacharacters deletes every current-plot vector whose name matches — e.g.\n"
    "unlet temp.*, unlet .*#branch (same grep-style regex selection as display;\n"
    "the scale vector is protected).\n"
    "\n"
    "See also: let, display, destroy.\n"
    "\n";

static const char mh_60[] =
    "version  —  session info   [batch + ui]\n"
    "also: sysinfo, rusage, history\n"
    "\n"
    "Synopsis:\n"
    "  version [n]     sysinfo     rusage [resource]     history [-r] [n]\n"
    "\n"
    "version prints the ngspice version (and can assert a minimum); sysinfo\n"
    "reports CPU/memory; rusage prints resource counters (time, memory,\n"
    "iterations) — useful for benchmarking; history lists past commands.\n"
    "\n"
    "See also: .option.\n"
    "\n";

static const char mh_61[] =
    "where  —  diagnostics   [batch + ui]\n"
    "also: dump, state, status\n"
    "\n"
    "Synopsis:\n"
    "  where     $ node/device with the largest residual (non-convergence)\n"
    "  dump      $ the circuit's node/branch matrix\n"
    "  state     $ current analysis state\n"
    "  status    $ analyses in progress and breakpoints\n"
    "\n"
    "Convergence and state introspection. where names the node or device carrying\n"
    "the largest residual after a failed Newton step — the first thing to check\n"
    "on a “no convergence” error; dump prints the raw matrix; state/status report\n"
    "the analysis and any breakpoints.\n"
    "\n"
    "See also: .option (tolerances), stop.\n"
    "\n";

static const char mh_62[] =
    "while  —  condition loops   [ui only]\n"
    "also: dowhile\n"
    "\n"
    "Synopsis:\n"
    "  while  condition          dowhile  condition\n"
    "    … body …                  … body …\n"
    "  end                       end\n"
    "\n"
    "See also: foreach, repeat.\n"
    "\n";

static const char mh_63[] =
    "wrdata  —  ASCII column data   [ui only]\n"
    "\n"
    "Synopsis:\n"
    "  wrdata  file  expr ...\n"
    "\n"
    "Writes the scale (time/frequency) and each expression as\n"
    "whitespace-separated columns of plain text — the easiest format to hand to\n"
    "gnuplot, a spreadsheet, or a script. Control mode only (no dot-card form). A\n"
    "double-quoted argument is a regular expression over the current plot —\n"
    "wrdata f.txt \".*#branch\" writes every branch current as columns (same rule\n"
    "as print).\n"
    "\n"
    "See also: print, write (binary raw), gnuplot.\n"
    "\n";

static const char mh_64[] =
    "write  —  r — two ways to make a raw file   [ui only]\n"
    "also: -r\n"
    "\n"
    "-r file dumps the run’s default (or .save-restricted) set to file. write\n"
    "file2 expr…, inside .control, writes a chosen set to file2. They coexist\n"
    "only if the filenames differ. A double-quoted argument is a regular\n"
    "expression over the current plot — write br.raw \".*#branch\" writes every\n"
    "branch current (same rule as print).\n"
    "\n"
    "See also: .tran, wrdata (ASCII columns), print, load (read a raw file back).\n"
    "\n";

static const char mh_65[] =
    "osdi  —  behavioral R/C → native   [batch + ui]\n"
    "\n"
    "See also: the OSDI codegen docs in the source (docs/osdi_codegen_overview/,\n"
    "osdi_res_codegen/, osdi_cap_codegen/).\n"
    "\n";

/* keys sorted for bsearch() */
static const struct minihelp_ent minihelp_tab[] = {
    { ".ac", mh_0 },
    { ".csparam", mh_7 },
    { ".dc", mh_8 },
    { ".disto", mh_13 },
    { ".else", mh_22 },
    { ".elseif", mh_22 },
    { ".endif", mh_22 },
    { ".ends", mh_55 },
    { ".four", mh_18 },
    { ".func", mh_34 },
    { ".global", mh_19 },
    { ".hb", mh_50 },
    { ".ic", mh_21 },
    { ".if", mh_22 },
    { ".include", mh_23 },
    { ".lib", mh_23 },
    { ".meas", mh_28 },
    { ".model", mh_29 },
    { ".nodeset", mh_21 },
    { ".noise", mh_30 },
    { ".op", mh_31 },
    { ".option", mh_32 },
    { ".options", mh_32 },
    { ".param", mh_34 },
    { ".plot", mh_35 },
    { ".print", mh_36 },
    { ".pss", mh_50 },
    { ".pz", mh_37 },
    { ".save", mh_41 },
    { ".sens", mh_42 },
    { ".sp", mh_50 },
    { ".step", mh_52 },
    { ".subckt", mh_55 },
    { ".temp", mh_56 },
    { ".tf", mh_57 },
    { ".tran", mh_58 },
    { "@", mh_5 },
    { "a", mh_1 },
    { "abstol", mh_32 },
    { "ac", mh_0 },
    { "alias", mh_2 },
    { "alter", mh_3 },
    { "altermod", mh_4 },
    { "bypass", mh_32 },
    { "cd", mh_47 },
    { "chgtol", mh_32 },
    { "codemodel", mh_1 },
    { "compose", mh_6 },
    { "cross", mh_40 },
    { "csparam", mh_7 },
    { "cutout", mh_40 },
    { "dc", mh_8 },
    { "define", mh_9 },
    { "delete", mh_53 },
    { "destroy", mh_44 },
    { "devhelp", mh_10 },
    { "devices", mh_10 },
    { "diff", mh_11 },
    { "display", mh_12 },
    { "disto", mh_13 },
    { "dowhile", mh_62 },
    { "dptran", mh_32 },
    { "dump", mh_61 },
    { "echo", mh_14 },
    { "edit", mh_49 },
    { "else", mh_22 },
    { "elseif", mh_22 },
    { "endif", mh_22 },
    { "ends", mh_55 },
    { "fclose", mh_16 },
    { "fft", mh_15 },
    { "floatgmin", mh_32 },
    { "fopen", mh_16 },
    { "foreach", mh_17 },
    { "four", mh_18 },
    { "fourier", mh_18 },
    { "fread", mh_16 },
    { "func", mh_34 },
    { "getcwd", mh_47 },
    { "global", mh_19 },
    { "gmin", mh_32 },
    { "goto", mh_20 },
    { "hb", mh_50 },
    { "help", mh_39 },
    { "history", mh_60 },
    { "ic", mh_21 },
    { "if", mh_22 },
    { "include", mh_23 },
    { "itl1", mh_32 },
    { "itl2", mh_32 },
    { "itl4", mh_32 },
    { "label", mh_20 },
    { "let", mh_24 },
    { "lib", mh_23 },
    { "linearize", mh_25 },
    { "listing", mh_26 },
    { "load", mh_27 },
    { "maxiterfloor", mh_32 },
    { "meas", mh_28 },
    { "method", mh_32 },
    { "mincap", mh_32 },
    { "minres", mh_32 },
    { "model", mh_29 },
    { "nodeset", mh_21 },
    { "noise", mh_30 },
    { "numdgt", mh_32 },
    { "op", mh_31 },
    { "option", mh_32 },
    { "options", mh_32 },
    { "osdi", mh_65 },
    { "other", mh_33 },
    { "param", mh_34 },
    { "plot", mh_35 },
    { "print", mh_24 },
    { "pss", mh_50 },
    { "pstran", mh_32 },
    { "pz", mh_37 },
    { "quit", mh_39 },
    { "rehash", mh_39 },
    { "reltol", mh_32 },
    { "repeat", mh_38 },
    { "reset", mh_39 },
    { "reshape", mh_40 },
    { "resume", mh_53 },
    { "rshunt", mh_32 },
    { "rusage", mh_60 },
    { "save", mh_41 },
    { "savecurrents", mh_32 },
    { "sens", mh_42 },
    { "set", mh_43 },
    { "setplot", mh_44 },
    { "setscale", mh_44 },
    { "setseed", mh_45 },
    { "settype", mh_46 },
    { "shell", mh_47 },
    { "show", mh_10 },
    { "showmod", mh_10 },
    { "snload", mh_48 },
    { "snsave", mh_48 },
    { "source", mh_49 },
    { "sp", mh_50 },
    { "spec", mh_51 },
    { "state", mh_61 },
    { "status", mh_61 },
    { "step", mh_52 },
    { "stop", mh_53 },
    { "strcmp", mh_54 },
    { "strslice", mh_54 },
    { "strstr", mh_54 },
    { "subckt", mh_55 },
    { "sysinfo", mh_60 },
    { "temp", mh_56 },
    { "tf", mh_57 },
    { "tnom", mh_32 },
    { "tran", mh_58 },
    { "transpose", mh_40 },
    { "trtol", mh_32 },
    { "unalias", mh_2 },
    { "unlet", mh_59 },
    { "version", mh_60 },
    { "vntol", mh_32 },
    { "where", mh_61 },
    { "while", mh_62 },
    { "wrdata", mh_63 },
    { "write", mh_64 },
    { "x", mh_55 },
};
static const int minihelp_ntab = 166;

static int mh_cmp(const void *key, const void *ent)
{
    return strcasecmp((const char *) key,
                      ((const struct minihelp_ent *) ent)->key);
}

const char *minihelp_lookup(const char *cmd)
{
    const struct minihelp_ent *e;
    if (!cmd || !*cmd)
        return (const char *) 0;
    e = (const struct minihelp_ent *) bsearch(cmd, minihelp_tab,
            (size_t) minihelp_ntab, sizeof(minihelp_tab[0]), mh_cmp);
    return e ? e->text : (const char *) 0;
}
