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

pkgxdev / pkgx / 12776318553

14 Jan 2025 09:02PM UTC coverage: 1.643% (-87.9%) from 89.526%
12776318553

push

github

mxcl
get coverage from running `pkgx` (#1072)

13 of 791 relevant lines covered (1.64%)

0.28 hits per line

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

0.0
/crates/cli/src/help.rs
1
use regex::Regex;
2

3
fn dim(input: &str) -> String {
×
4
    // Placeholder function for "dim" styling
5
    format!("\x1b[2m{}\x1b[0m", input)
×
6
}
7

8
pub fn usage() -> String {
×
9
    let usage = r##"
×
10
usage:
11
  pkgx [+pkg@x.y…] <program|path> [--] [arg…]
12

13
examples:
14
  $ pkgx gum format "# hello world" "sup?"
15
  $ pkgx node@18 --eval 'console.log("hello world")'
16
  $ pkgx +openssl cargo build
17

18
flags:
19
  -s, --silent  # no chat. no errors. just execute.
20
  --version
21

22
more:
23
  $ open https://docs.pkgx.sh
24
"##;
25

26
    let usage = usage
×
27
        .replace('[', &dim("["))
×
28
        .replace(']', &dim("]"))
×
29
        .replace('<', &dim("<"))
×
30
        .replace('>', &dim(">"))
×
31
        .replace('$', &dim("$"))
×
32
        .replace('|', &dim("|"));
×
33

34
    let re = Regex::new("(?m) #.*$").unwrap();
×
35

36
    re.replace_all(&usage, |caps: &regex::Captures| {
×
37
        dim(caps.get(0).unwrap().as_str())
×
38
    })
39
    .to_string()
40
}
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