coreutils_rs/
config.rs

1use clap::Parser;
2
3#[derive(Parser)]
4#[command(version, about = "Copy file from <source> to <dest>")]
5pub struct CpCli {
6    #[arg(short, long)]
7    pub source: String,
8    #[arg(short, long)]
9    pub dest: String,
10}
11
12#[derive(Parser)]
13#[command(version, about = "Return lines from text file <file> including <query> phrase. \
14Setting <ignore_case> will impose case insensitivity")]
15pub struct GrepCli {
16    #[arg(short, long)]
17    pub query: String,
18    #[arg(short, long)]
19    pub file: String,
20    #[arg(short, long)]
21    pub ignore_case: bool,
22}
23
24#[derive(Parser)]
25#[command(version, about = "List files and directories inside <dir>")]
26pub struct LsCli {
27    #[arg(short, long)]
28    pub dir: String,
29}
30
31#[derive(Parser)]
32#[command(version, about = "Return <num_lines> first lines from a text file <file>")]
33pub struct HeadCli {
34    #[arg(short, long)]
35    pub file: String,
36    #[arg(short, long)]
37    pub num_lines: u32,
38}