correctly identify when format is csv
This commit is contained in:
parent
fdc45cea3f
commit
52c70d6f66
|
@ -36,6 +36,7 @@ impl Formatter {
|
|||
Formatter::Text => text::print_formatted(entries, out, now, ids, term_width)?,
|
||||
Formatter::Csv => csv::print_formatted(entries, out, ids)?,
|
||||
Formatter::Custom(name) => {
|
||||
panic!("attempted custom formatter with name {} which is not implemented", name);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -51,6 +52,7 @@ impl FromStr for Formatter {
|
|||
|
||||
Ok(match &*lower {
|
||||
"text" => Formatter::Text,
|
||||
"csv" => Formatter::Csv,
|
||||
custom_format => Formatter::Custom(custom_format.into()),
|
||||
})
|
||||
}
|
||||
|
|
|
@ -123,7 +123,7 @@ fn main() {
|
|||
.arg(Arg::with_name("format")
|
||||
.short("f").long("format")
|
||||
.takes_value(true).value_name("FORMAT").default_value("text")
|
||||
.help("The output format. Valid built-in formats are ical, csv, json, ids, factor, and text. Documentation on defining custom formats can be found in the README included in this distribution."))
|
||||
.help("The output format. Valid built-in formats are ical, csv, json, ids, factor, and text. Documentation on defining custom formats can be found in the README included in this distribution."))
|
||||
.arg(Arg::with_name("grep")
|
||||
.short("g").long("grep")
|
||||
.takes_value(true).value_name("REGEXP")
|
||||
|
|
Loading…
Reference in New Issue