• 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

0.0
/cli/src/gencomp.rs
1
#[cfg(debug_assertions)]
2
mod generator {
3
    use clap::{Command, CommandFactory};
4
    use clap_complete::Shell;
5
    use std::fs::File;
6
    use std::path::{Path, PathBuf};
7

8
    #[cfg(debug_assertions)]
NEW
9
    fn generate_impl(s: Shell, app: &mut Command, appname: &str, outdir: &Path, file: String) {
×
NEW
10
        let destfile = outdir.join(file);
×
NEW
11
        std::fs::create_dir_all(destfile.parent().unwrap()).unwrap();
×
NEW
12
        let mut dest = File::create(destfile).unwrap();
×
NEW
13

×
NEW
14
        clap_complete::generate(s, app, appname, &mut dest);
×
NEW
15
    }
×
16

NEW
17
    pub(super) fn generate(outdir: PathBuf) {
×
NEW
18
        let appname = "sibling";
×
NEW
19

×
NEW
20
        let mut app = crate::cli::CliOpts::command();
×
NEW
21
        app.set_bin_name(appname);
×
NEW
22

×
NEW
23
        generate_impl(
×
NEW
24
            Shell::Bash,
×
NEW
25
            &mut app,
×
NEW
26
            appname,
×
NEW
27
            &outdir,
×
NEW
28
            format!("bash/{}", appname),
×
NEW
29
        );
×
NEW
30
        generate_impl(
×
NEW
31
            Shell::Elvish,
×
NEW
32
            &mut app,
×
NEW
33
            appname,
×
NEW
34
            &outdir,
×
NEW
35
            format!("elvish/{}", appname),
×
NEW
36
        );
×
NEW
37
        generate_impl(
×
NEW
38
            Shell::Fish,
×
NEW
39
            &mut app,
×
NEW
40
            appname,
×
NEW
41
            &outdir,
×
NEW
42
            format!("fish/{}", appname),
×
NEW
43
        );
×
NEW
44
        generate_impl(
×
NEW
45
            Shell::PowerShell,
×
NEW
46
            &mut app,
×
NEW
47
            appname,
×
NEW
48
            &outdir,
×
NEW
49
            format!("powershell/{}", appname),
×
NEW
50
        );
×
NEW
51
        generate_impl(
×
NEW
52
            Shell::Zsh,
×
NEW
53
            &mut app,
×
NEW
54
            appname,
×
NEW
55
            &outdir,
×
NEW
56
            format!("zsh/_{}", appname),
×
NEW
57
        );
×
NEW
58
    }
×
59
}
60

61
#[allow(dead_code, unused_variables)]
NEW
62
pub(crate) fn generate(outdir: std::path::PathBuf) {
×
NEW
63
    #[cfg(debug_assertions)]
×
NEW
64
    generator::generate(outdir);
×
NEW
65
}
×
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

© 2026 Coveralls, Inc