// WARN: This file is auto generated by flood-tide-gen const OPTIONS_TEXT: &str = r"Options: -H, --help display this help and exit -V, --version display version information and exit "; #[repr(u8)] #[derive(Debug, PartialEq, Eq)] enum CmdOp { Help, Version, } impl std::convert::From for CmdOp { fn from(value: u8) -> Self { unsafe { std::mem::transmute(value) } } } impl CmdOp { pub const fn to(self) -> OptNum { self as OptNum } } #[rustfmt::skip] const OPT_ARY: [Opt;2] = [ Opt { sho: b'H', lon: "help", has: Arg::No, num: CmdOp::Help.to(), }, Opt { sho: b'V', lon: "version", has: Arg::No, num: CmdOp::Version.to(), }, ]; #[rustfmt::skip] const OPT_ARY_SHO_IDX: [(u8,usize);2] = [ (b'H',0),(b'V',1),]; #[derive(Debug, PartialEq, Eq)] pub struct SubCmdOptConf<'a> { pub parent: &'a CmdOptConf, pub prog_name: String, // pub flg_help: bool, pub flg_version: bool, // pub arg_params: Vec, } impl<'a> SubCmdOptConf<'a> { pub fn new(a_parent: &'a CmdOptConf, a_prog_name: String) -> SubCmdOptConf<'a> { SubCmdOptConf { parent: a_parent, prog_name: a_prog_name, // flg_help: Default::default(), flg_version: Default::default(), // arg_params: Vec::new(), } } } impl<'a> flood_tide::HelpVersion for SubCmdOptConf<'a> { fn is_help(&self) -> bool { self.flg_help } fn is_version(&self) -> bool { self.flg_version } }