• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tamada / sibling / 14030358000

24 Mar 2025 08:16AM UTC coverage: 56.952% (-13.3%) from 70.292%
14030358000

Pull #37

github

tamada
refactor: rename module from gencomp to generator and improve path handling in Dirs
Pull Request #37: Separate cli and lib

255 of 448 new or added lines in 6 files covered. (56.92%)

299 of 525 relevant lines covered (56.95%)

3.38 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

47.06
/cli/src/cli.rs
1
use std::path::PathBuf;
2

3
use clap::Parser;
4

5
#[derive(Debug, Parser)]
6
#[clap(version, author, about, arg_required_else_help = true)]
7
pub struct CliOpts {
8
    #[clap(flatten)]
9
    pub(crate) p_opts: PrintingOpts,
10

11
    #[arg(
12
        short,
13
        long,
14
        help = "specify the number of times to execute sibling",
15
        value_name = "COUNT",
16
        default_value_t = 1
1✔
17
    )]
NEW
18
    pub step: usize,
×
19

20
    #[arg(
21
        long,
22
        help = "generate the initialize script for the shell",
23
        value_name = "SHELL",
24
        hide = true,
25
        default_missing_value = "bash"
26
    )]
27
    pub init: Option<String>,
28

29
    #[arg(short = 't', long = "type", help = "specify the nexter type", value_enum, default_value_t = sibling::NexterType::Next, value_name = "TYPE", ignore_case = true)]
1✔
NEW
30
    pub nexter: sibling::NexterType,
×
31

32
    #[arg(
33
        short,
34
        long,
35
        help = "directory list from file, if FILE is \"-\", reads from stdin.",
36
        value_name = "FILE"
37
    )]
38
    pub input: Option<String>,
39

40
    #[arg(index = 1, help = "the target directory", value_name = "DIR")]
41
    pub dirs: Vec<PathBuf>,
1✔
42

43
    #[cfg(debug_assertions)]
44
    #[clap(flatten)]
45
    pub(crate) compopts: CompletionOpts,
46
}
47

48
#[cfg(debug_assertions)]
49
#[derive(Parser, Debug)]
50
pub(crate) struct CompletionOpts {
51
    #[arg(
52
        long = "generate-completion-files",
53
        help = "Generate completion files",
54
        hide = true
55
    )]
NEW
56
    pub(crate) completion: bool,
×
57

58
    #[arg(
59
        long = "completion-out-dir",
60
        value_name = "DIR",
61
        default_value = "assets/completions",
62
        help = "Output directory of completion files",
63
        hide = true
64
    )]
NEW
65
    pub(crate) dest: PathBuf,
×
66
}
67

68
#[derive(Debug, Parser)]
69
pub(crate) struct PrintingOpts {
70
    #[arg(
71
        long,
72
        help = "print the result in the csv format",
73
        default_value_t = false,
1✔
74
        hide = true
75
    )]
NEW
76
    pub csv: bool,
×
77

78
    #[arg(
79
        short,
80
        long,
81
        help = "print the directory name in the absolute path",
82
        default_value_t = false
1✔
83
    )]
NEW
84
    pub absolute: bool,
×
85

86
    #[arg(
87
        short,
88
        long,
89
        help = "list the sibling directories",
90
        default_value_t = false
1✔
91
    )]
NEW
92
    pub list: bool,
×
93

94
    #[arg(
95
        short,
96
        long,
97
        help = "print the progress of traversing directories",
98
        default_value_t = false
1✔
99
    )]
NEW
100
    pub progress: bool,
×
101

102
    #[arg(
103
        short = 'P',
104
        long,
105
        help = "print parent directory, when no more sibling directories are found",
106
        default_value_t = false
1✔
107
    )]
NEW
108
    pub parent: bool,
×
109
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc