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

pkgxdev / pkgx / 12768583963

14 Jan 2025 01:23PM UTC coverage: 1.643% (-90.3%) from 91.907%
12768583963

Pull #1068

github

web-flow
Merge aab1de74e into 6a195bfb8
Pull Request #1068: v2

13 of 791 new or added lines in 17 files covered. (1.64%)

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

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

NEW
8
pub fn usage() -> String {
×
NEW
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

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

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

NEW
36
    re.replace_all(&usage, |caps: &regex::Captures| {
×
NEW
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

© 2025 Coveralls, Inc