rust/utils: Add 'ExitCodeTrait' and an macro that implements the trait

A manpage auto-generation tool can use this trait to get the exit codes
and their documentation of a program.

Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Marc Hartmayer
2024-11-28 14:03:26 +01:00
committed by Jan Höppner
parent ea297ecf84
commit d73f4dc22a
2 changed files with 173 additions and 0 deletions
+2
View File
@@ -4,6 +4,7 @@
//!
//! Copyright IBM Corp. 2023, 2024
mod cli;
mod exit_code;
mod file;
mod hexslice;
mod log;
@@ -16,6 +17,7 @@ pub use crate::{
get_reader_from_cli_file_arg, get_writer_from_cli_file_arg, print_cli_error, print_error,
CertificateOptions, DeprecatedVerbosityOptions, VerbosityOptions, STDIN, STDOUT,
},
exit_code::{docstring, ExitCodeDoc, ExitCodeTrait, ExitCodeVariantDoc},
file::{AtomicFile, AtomicFileOperation},
hexslice::HexSlice,
log::PvLogger,