MCPcopy Create free account
hub / github.com/arraypad/each / add_arguments

Method add_arguments

src/formats/csv.rs:67–91  ·  view source on GitHub ↗
(&self, args: clap::Command<'a>)

Source from the content-addressed store, hash-verified

65
66impl 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") {

Callers 1

mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected