I added an example to the --terse entry in the manual. Debian should close this bug.
On Thu, Jun 29, 2023 at 07:55:59AM -0500, Dan Jacobson wrote: > Ah ha! > You see the batch job user scours the man page, and only finds: > > > -1, --one-line > Give only one line of output (the forward conversion); do not > print the reverse conversion. If a reciprocal conversion is > performed, then units will still print the “reciprocal conver‐ > sion” line. > > -t, --terse > Print only a single conversion factor. This option can be used > when calling units from another program so that the output is > easy to parse. This option has the combined effect of these op‐ > tions: ‘--strict’ ‘--quiet’ ‘--one-line’ ‘--compact’. When > combined with ‘--version’ it produces a display showing only the > program name and version number. > > --compact > Give compact output featuring only the conversion factor; the > multiplication and division signs are not shown, and there is no > leading whitespace. If you convert to a unit list, then the > output is a semicolon separated list of factors. This turns off > the ‘--verbose’ option. > > But in fact, --terse should say: > > -t, --terse > Print only a single conversion factor. This option can be used > when calling units from another program so that the output is > easy to parse. This option has the combined effect of these op‐ > tions: ‘--strict’ ‘--quiet’ ‘--one-line’ ‘--compact’. When > combined with ‘--version’ it produces a display showing only the > program name and version number. And here we even strip > the units off: > > $ units --terse mile meters > 1609.344 > > I am saying that people who are looking to strip things down... their > eyes will focus on that part of the man page, so be sure to repeat that > feature there. > > So indeed, there is no need for things like, > > $ dlocate --help > -f, --filename-only Strip 'package: ' prefix from search output > -p, --package-only Output package names only when searching > > because units already has what it needs. It just needs to mention it on > the right spot on the man page again. Thanks.