Crates.io | verbosity |
lib.rs | verbosity |
version | 0.1.0 |
source | src |
created_at | 2021-10-26 18:44:26.172322 |
updated_at | 2021-10-26 18:44:26.172322 |
description | Utility library for working with cli output ergonomically |
homepage | https://github.com/Nejat/verbosity-rs |
repository | https://github.com/Nejat/verbosity-rs |
max_upload_size | |
id | 472039 |
size | 10,386 |
Intended for use with cli
commands this library lets you set a singleton [Verbosity
]
option to indicate different levels of reporting, i.e. Quite
| Terse
| Verbose
let level = Verbosity::from_str(
&std::env::args().last().unwrap_or(String::new())
).unwrap_or(Verbosity::Quite);
level.set_as_global();
match Verbosity::level() {
Quite => {}
Terse =>
println!("terse message"),
Verbose =>
println!("overly verbose message for some command")
}
The cli-toolbox
crate uses this library to provide a more ergonomic way of
controlling reporting output
i.e.
let level = Verbosity::from_str(
&std::env::args().last().unwrap_or(String::new())
).unwrap_or(Verbosity::Quite);
level.set_as_global();
report! {
@terse "terse message"
@verbose "overly verbose message for some command"
}
[dependencies]
verbosity = "0.1"