Not much has changed visually but should be a good basis to build more sophisticated visualizations on top of
YTW5RB26IF3MHIED6RA3AQ7KAZHPLABJ63WFSGAO6FAATFFCP4UAC
impl From<&Arg> for ArgType {
impl ValueType {
fn name(&self) -> &str {
match self {
Self::Path => "path",
Self::Command => "command",
Self::Name => "name",
Self::Url => "url",
Self::Email => "email",
Self::String => "string",
Self::Range => "range",
Self::Bool => "bool",
Self::Enum => "enum",
Self::Map => "map",
Self::Unknown => "unknown",
}
}
}
impl From<&Arg> for ValueType {
let type_id = value.get_value_parser().type_id();
if type_id == value_parser!(String).type_id() {
Self::String
} else {
Self::Other
match value.get_value_hint() {
ValueHint::AnyPath => Self::Path,
ValueHint::FilePath => Self::Path,
ValueHint::DirPath => Self::Path,
ValueHint::ExecutablePath => Self::Path,
ValueHint::CommandName => Self::Command,
ValueHint::CommandString => Self::Command,
ValueHint::CommandWithArguments => Self::Command,
ValueHint::Username => Self::Name,
ValueHint::Hostname => Self::Name,
ValueHint::Url => Self::Url,
ValueHint::EmailAddress => Self::Email,
_ => {
let type_id = value.get_value_parser().type_id();
if type_id == ValueParser::new(RangedU64ValueParser::<u8>::new()).type_id() {
Self::Range
} else if type_id == ValueParser::new(RangedU64ValueParser::<u16>::new()).type_id()
{
Self::Range
} else if type_id == ValueParser::new(RangedU64ValueParser::<u32>::new()).type_id()
{
Self::Range
} else if type_id == ValueParser::new(RangedU64ValueParser::<u64>::new()).type_id()
{
Self::Range
} else if type_id == ValueParser::new(RangedI64ValueParser::<i8>::new()).type_id() {
Self::Range
} else if type_id == ValueParser::new(RangedI64ValueParser::<i16>::new()).type_id()
{
Self::Range
} else if type_id == ValueParser::new(RangedI64ValueParser::<i32>::new()).type_id()
{
Self::Range
} else if type_id == ValueParser::new(RangedI64ValueParser::<i64>::new()).type_id()
{
Self::Range
} else if type_id == ValueParser::string().type_id() {
Self::String
} else {
Self::Unknown
}
}
let supported_type_description = ArgType::from(arg);
el::span(match supported_type_description {
ArgType::String => "string",
ArgType::Other => "other",
})
let value_type = ValueType::from(arg);
el::details(el::summary(value_type.name().to_string()))