paholg / dimensioned

Compile-time dimensional analysis for various unit systems using Rust's type system.
https://crates.io/crates/dimensioned
MIT License
300 stars 23 forks source link

add auto-args feature #70

Closed droundy closed 3 years ago

droundy commented 4 years ago

This allows us to support auto-args trait enabling command-line… arguments with dimensions.

The current missing feature that I'd love to have is to be able to make the help message specify the actual units expected. But I don't see any easy way to get the units out of a type.

paholg commented 3 years ago

Sorry for the delay; this looks good to me.

The various format implementations already get the units from the type, they just also get the value. It should be easy enough to separate those, and make a static method that formats just the units.