$ dimvexa convert 1 ton kg --json
[exit 1]
--- stdout
{"schema":"dimvexa.convert/1","ok":false,"error":{"code":"ambiguous_symbol","message":"'ton' is ambiguous: use ton_short or ton_long or tonne, or choose a profile","candidates":["ton_short","ton_long","tonne"],"suggestions":["ton_short","ton_long","tonne"]}}
--- stderr
$ dimvexa convert 1 gal L
[exit 1]
--- stdout
--- stderr
error[ambiguous_symbol]: 'gal' is ambiguous: use gal_us or gal_imp, or choose a profile
$ dimvexa convert 1 kcal J --json
[exit 1]
--- stdout
{"schema":"dimvexa.convert/1","ok":false,"error":{"code":"ambiguous_symbol","message":"'kcal' is ambiguous: use kcal_th or kcal_IT, or choose a profile","candidates":["kcal_th","kcal_IT"],"suggestions":["kcal_th","kcal_IT"]}}
--- stderr
$ dimvexa convert 1 H s --json
[exit 1]
--- stdout
{"schema":"dimvexa.convert/1","ok":false,"error":{"code":"dimension_mismatch","message":"dimension mismatch: [kg m^2 s^-2 A^-2] cannot be converted to [s]"}}
--- stderr
$ dimvexa convert 1 m s --json
[exit 1]
--- stdout
{"schema":"dimvexa.convert/1","ok":false,"error":{"code":"dimension_mismatch","message":"dimension mismatch: [m] cannot be converted to [s]"}}
--- stderr
$ dimvexa convert 1 J/mol.K J/mol/K
[exit 1]
--- stdout
--- stderr
error[ambiguous_expression]: ambiguous expression 'J/mol.K': a multiplication after a division (position 5) can be read two ways; write a/(b.c) or (a/b).c
$ dimvexa convert 20 degC delta_degC
[exit 1]
--- stdout
--- stderr
error[kind_mismatch]: kind mismatch in conversion: absolute_temperature and temperature_difference are not compatible (a temperature point and a temperature difference are different kinds; for a difference use delta_degC)
$ dimvexa convert 5 K delta_degF --json
[exit 1]
--- stdout
{"schema":"dimvexa.convert/1","ok":false,"error":{"code":"kind_mismatch","message":"kind mismatch in conversion: absolute_temperature and temperature_difference are not compatible (a temperature point and a temperature difference are different kinds; for a difference use delta_K)","suggestions":["delta_K"]}}
--- stderr
$ dimvexa convert 1 degC/s K/s --json
[exit 1]
--- stdout
{"schema":"dimvexa.convert/1","ok":false,"error":{"code":"refused","message":"refused: 'degC' has an offset (temperature scale) and cannot be part of a compound unit; use the difference unit delta_degC for a temperature difference","suggestions":["delta_degC"]}}
--- stderr
$ dimvexa convert 1 ppm 1
[exit 1]
--- stdout
--- stderr
error[ambiguous_symbol]: 'ppm' is ambiguous: use ppmw (planned) or ppmv (planned) or ppmmol (planned), or choose a profile
$ dimvexa convert 1 m
[exit 2]
--- stdout
--- stderr
error[usage]: expected VALUE FROM TO, got 2 argument(s); try 'dimvexa --help'
Usage:
dimvexa convert VALUE FROM TO [--exact] [--json] [--config FILE]... [--bridge NAME]
dimvexa VALUE FROM TO [--exact] [--json] [--config FILE]... [--bridge NAME]
dimvexa units [--groups | GROUP | UNIT] [--json] [--config FILE]...
Converts VALUE from unit FROM to unit TO.
Commands:
units list the supported units grouped by quantity, and the ambiguous symbols
that are refused
units --groups list only the groups (length, mass, volume, ...) with their sizes
units GROUP list one group, for example: dimvexa units volume
units UNIT show the details of one unit, for example: dimvexa units psi
Options:
--exact print the exact rational result (num/den) instead of a decimal
--json machine-readable output (schema dimvexa.convert/1; dimvexa.units/1 for units)
--config FILE (beta) apply your own names, units and densities, e.g. mt = "tonne" (repeatable; see
docs/adr/009-user-config.md). Nothing is loaded unless you name the file
--bridge NAME use a density from a [[bridge]] in your config for mass <-> volume, e.g.
--config water.toml --bridge water_20C; the assumption is printed with the result
--version print version and data table version
-h, --help print this help
Examples:
dimvexa convert 10 m/s km/h
dimvexa convert 1 psi Pa --exact
dimvexa convert 100 degC degF --json
dimvexa convert 1 mt kg --config trade.toml
dimvexa convert 1 L kg --config water.toml --bridge water_20C
dimvexa convert 1 bbl_oil L --config oil.toml
Precision: the CLI always uses the exact path, so the number printed is the exact result
rounded once to the nearest f64 (0 ulp). The library's fast f64 path is within 1 ulp (linear
units) or 2 ulp (temperature scales such as degC and degF) of it; see docs/precision.md.
Exit codes: 0 success, 1 conversion refused or invalid input, 2 usage error.