| 65 | |
| 66 | impl Format for Csv { |
| 67 | fn add_arguments<'a>(&self, args: clap::Command<'a>) -> clap::Command<'a> { |
| 68 | args.arg( |
| 69 | Arg::new("csv-delimiter") |
| 70 | .long("csv-delimiter") |
| 71 | .value_name("CHAR") |
| 72 | .help("The field delimiter to use when parsing CSV") |
| 73 | .default_value(",") |
| 74 | .takes_value(true), |
| 75 | ) |
| 76 | .arg( |
| 77 | Arg::new("csv-quote") |
| 78 | .long("csv-quote") |
| 79 | .value_name("CHAR") |
| 80 | .help("The quote character to use when parsing CSV") |
| 81 | .default_value("\"") |
| 82 | .takes_value(true), |
| 83 | ) |
| 84 | .arg( |
| 85 | Arg::new("csv-escape") |
| 86 | .long("csv-escape") |
| 87 | .value_name("CHAR") |
| 88 | .help("The escape character to use when parsing CSV [defaults to double quoting]") |
| 89 | .takes_value(true), |
| 90 | ) |
| 91 | } |
| 92 | |
| 93 | fn set_arguments(&mut self, matches: &clap::ArgMatches) -> Result<(), Error> { |
| 94 | self.delimiter = match matches.value_of("csv-delimiter") { |