fix(dtmt): Fix dictionary lookup for all groups

Rather than checking all groups, when no cli flag was given, no groups
were checked.
This commit is contained in:
Lucas Schwiderski 2023-02-17 11:18:50 +01:00
parent 036c20bd8c
commit 110108004d
Signed by: lucas
GPG key ID: AA12679AAA6DF4D8

View file

@ -29,6 +29,17 @@ impl From<HashGroup> for sdk::murmur::HashGroup {
}
}
impl std::fmt::Display for HashGroup {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
HashGroup::Filename => write!(f, "filename"),
HashGroup::Filetype => write!(f, "filetype"),
HashGroup::Strings => write!(f, "strings"),
HashGroup::Other => write!(f, "other"),
}
}
}
#[derive(cli_table::Table)]
struct TableRow {
#[table(title = "Value")]
@ -68,7 +79,8 @@ pub(crate) fn command_definition() -> Command {
.short('g')
.long("group")
.action(ArgAction::Append)
.value_parser(value_parser!(HashGroup)),
.value_parser(value_parser!(HashGroup))
.default_values(["other", "filename", "filetype", "strings"]),
),
)
.subcommand(