necpp icon indicating copy to clipboard operation
necpp copied to clipboard

Full output to stdout if output filename is "-".

Open aknrdureegaesr opened this issue 1 year ago • 0 comments

The program's help message previously was like this:

usage: nec2++ [-i<input-file-name>] [-o<output-file-name>]
       -g: print maximum gain to stdout.
       -b: Perform NEC++ Benchmark.
       -s: print results to standard output.
       -c: print results in comma-separated-value (CSV) format,
           this options is used in conjunction with (-s) above.
       -h: print this usage information and exit.
       -v: print nec2++ version number and exit.

This fooled me into thinking I could get the simulation results via the -s command line switch. But what I actually got was a excerpt, one might call it a summary.

This actually threw me off. For some time, it was my impression that the program does considerably less calculation than what one has come to expect from a NEC2 implementation. Only after generating and reading a regular output file (accidentally), I realized that the output generated by -s is sorely incomplete.

And there was no defined way to have that output piped to stdout. To have this is very convenient in a scripting environment.

This pull request addresses that problem, in two ways:

  • The usage message is corrected to more clearly indicate that -s produces reduced output.
  • When providing -o - as the output file, the full output is produced on stdout instead of a file.

aknrdureegaesr avatar Oct 04 '24 19:10 aknrdureegaesr