spcsv/
args.rs

1use clap::{ColorChoice, Parser};
2
3#[derive(Parser, Debug)]
4#[clap(about, version, name = "spcsv", color(ColorChoice::Never))]
5pub struct Args {
6    /// The csv file to split
7    #[clap(required = true)]
8    pub(crate) file: String,
9
10    /// The number of files to be created with the contents of the original csv file
11    #[clap(required = true)]
12    pub(crate) number_of_files: usize,
13
14    /// The first line of FILE is NOT a header line. [By default it is]
15    #[clap(short, long)]
16    pub(crate) not_signed_file: bool,
17
18    /// Write remaining lines in the last file [By default remaining rows are written to a new extra file]
19    #[clap(short, long)]
20    pub(crate) remaining_in_last: bool,
21
22    /// Print when file is created
23    #[clap(short, long)]
24    pub(crate) verbose: bool,
25}
26
27impl Args {
28    pub fn load() -> Args {
29        Args::parse()
30    }
31}