mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
utils: Add utils_macros: Implement ValueEnumDisplay and ValueEnumFromStr macros
Add new derive macros ValueEnumDisplay and ValueEnumFromStr which can be used to derive 'Display' and 'FromStr' for enums implementing 'clap::ValueEnum'. It helps in reducing boilerplate code and keep things in sync. Assisted-by: IBM Bob:1.0.4 Signed-off-by: Marc Hartmayer <marc@linux.ibm.com> Reviewed-by: Steffen Eiden <seiden@linux.ibm.com> Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
This commit is contained in:
committed by
Steffen Eiden
parent
173a055372
commit
618e22e38b
@@ -12,5 +12,7 @@ log = { version = "0.4.29", features = ["std", "release_max_level_debug"] }
|
||||
pv = { path = "../pv", package = "s390_pv" }
|
||||
serde = { version = "1.0.228"}
|
||||
|
||||
utils_macros = { path = "../utils_macros" }
|
||||
|
||||
[dev-dependencies]
|
||||
serde_json = "1.0.149"
|
||||
|
||||
@@ -13,6 +13,8 @@ mod log;
|
||||
mod tmpfile;
|
||||
|
||||
pub use ::log::LevelFilter;
|
||||
// Re-export procedural macros from utils_macros
|
||||
pub use utils_macros::{ValueEnumDisplay, ValueEnumFromStr};
|
||||
|
||||
pub use crate::cli::{
|
||||
combined_path_opt, combined_path_req, get_reader_from_cli_file_arg,
|
||||
|
||||
Reference in New Issue
Block a user