dfinity / dfxvm

dfx version manager
Apache License 2.0
7 stars 5 forks source link

refactor: err macro #5

Closed ericswanson-dfinity closed 11 months ago

ericswanson-dfinity commented 11 months ago

Description

Refactors the error reporting and styling into a macro for use elsewhere. Mostly copied from https://github.com/rust-lang/rustup/blob/master/src/cli/log.rs.

How Has This Been Tested?

Existing tests and

$ cargo run install a.b.c
    Finished dev [unoptimized + debuginfo] target(s) in 0.05s
     Running `target/debug/dfxvm install a.b.c`
error: invalid value 'a.b.c' for '<VERSION>': unexpected character 'a' while parsing major version number