Skip to content

Commit dd4dfe6

Browse files
Armin BecherArmin Becher
authored andcommitted
fix: add csv arg
1 parent 1fdb7ec commit dd4dfe6

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/cli.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@ pub fn parse_args() -> Config {
105105
.action(ArgAction::SetTrue)
106106
.required(false),
107107
)
108+
.arg(
109+
Arg::new("csv")
110+
.long("csv")
111+
.value_name("CSV_FILE")
112+
.help("set the output file for the CSV report")
113+
.required(false),
114+
)
108115
.arg(
109116
Arg::new("gituntracked")
110117
.long("gituntracked")
@@ -141,6 +148,11 @@ pub fn parse_args() -> Config {
141148
opt.throttle = Some(throttle);
142149
}
143150

151+
if let Some(f) = matches.get_one::<String>("csv") {
152+
opt.csv_file =
153+
Some(Path::new(&f.replace(['/', '\\'], std::path::MAIN_SEPARATOR_STR)).to_path_buf());
154+
}
155+
144156
if let Some(markup_types) = matches.get_many::<String>("markup-types") {
145157
opt.markup_types = Some(
146158
markup_types

0 commit comments

Comments
 (0)