quicli v0.4.0 Release Notes
Release Date: 2018-12-06 // over 4 years ago-
๐ This release is only compatible with Rust 1.31.0 and later.
โ Added
- The
CliResult
type alias was added as an easy to write type to be used as an return type inmain
functions. It uses theexitfailure
crate internally. - The
remove_dir_all
function that works as expected on all platforms.
โ Removed
- ๐ The
Result
type alias has been removed from the prelude.
To migrate from 0.3, please replace
Result<$X>
withResult<$X, Error>
.- Structopt is no longer re-exported.
To migrate from 0.3, please add
structopt = "0.2"
to yourCargo.toml
, and adduse structopt::StructOpt;
to your source files.- ๐ The
main!
macro has been removed. It was the cause of much confusion and was originally introduced to work around the lack of support for using the?
operator in themain
function.
To migrate from 0.3, you should use a regular
main
function likefn main() -> CliResult { Ok(()) }
. You'll need to returnOk(())
at the end to indicate the program was successful.To get access to your CLI arguments, use
let args = Cli::from_args();
(adjust theCli
name with the name of your struct that derivesStructOpt
.)To enable logging, it is easiest to add the line
args.verbosity.setup_env_logger(&env!("CARGO_PKG_NAME"))?;
right after the previous one loading the CLI arguments. You can also initialize a custom logger with the right log level directly by accessingargs.verbosity.log_level()
. - The
Previous changes from v0.3.1
-
๐ Changed
- โก๏ธ Updated failure to 0.1.2 and use
iter_cause()
to silence deprecation warnings
- โก๏ธ Updated failure to 0.1.2 and use