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:
Marc Hartmayer
2026-05-27 15:56:07 +02:00
committed by Steffen Eiden
parent 173a055372
commit 618e22e38b
6 changed files with 191 additions and 0 deletions
+11
View File
@@ -1225,6 +1225,17 @@ dependencies = [
"s390_pv",
"serde",
"serde_json",
"utils_macros",
]
[[package]]
name = "utils_macros"
version = "0.12.0"
dependencies = [
"clap",
"proc-macro2",
"quote",
"syn",
]
[[package]]