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

voiceapiai / ralertsinua / 9163272078

20 May 2024 06:26PM UTC coverage: 31.191% (+2.0%) from 29.214%
9163272078

Pull #12

github

web-flow
Merge d84eb014e into 863e03c21
Pull Request #12: fix(deps): cross-compile needs musl target, introduce dockerfile & ttyd

57 of 99 new or added lines in 6 files covered. (57.58%)

1 existing line in 1 file now uncovered.

626 of 2007 relevant lines covered (31.19%)

4.56 hits per line

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

0.0
/src/cli.rs
1
use crate::utils::version;
2
use clap::Parser;
3

4
#[derive(Parser, Debug)]
5
#[command(author, version = version(), about)]
6
pub struct Cli {
7
    #[arg(
8
        short,
9
        long,
10
        value_name = "TOKEN",
11
        help = "API token provided by alerts.in.ua",
12
        default_value = "",
13
        required = false
14
    )]
15
    pub token: String,
×
16

17
    #[arg(short, long, value_name = "LOCALE", help = "Locale", required = false, value_parser = get_available_locales(), default_value = get_default_locale())]
18
    pub locale: String,
×
19

20
    #[arg(
21
        long,
22
        value_name = "LOG_FILE",
23
        help = "Path to log file",
24
        default_value = ""
25
    )]
NEW
26
    pub log_file: String,
×
27

28
    #[arg(
29
        long,
30
        value_name = "FLOAT",
31
        help = "Tick rate, i.e. number of ticks per second",
32
        default_value_t = 1.0
×
33
    )]
34
    pub tick_rate: f64,
×
35

36
    #[arg(
37
        long,
38
        value_name = "FLOAT",
39
        help = "Frame rate, i.e. number of frames per second",
40
        default_value_t = 1.0
×
41
    )]
42
    pub frame_rate: f64,
×
43
}
44

45
#[inline]
NEW
46
fn get_available_locales() -> Vec<&'static str> {
×
NEW
47
    let locales = rust_i18n::available_locales!();
×
NEW
48
    if locales.is_empty() {
×
NEW
49
        return vec!["en", "uk"];
×
NEW
50
    }
×
NEW
51

×
NEW
52
    locales
×
NEW
53
}
×
54

55
#[inline]
NEW
56
fn get_default_locale() -> String {
×
NEW
57
    match sys_locale::get_locale() {
×
NEW
58
        Some(sl) => sl[..2].to_string(),
×
NEW
59
        None => "en".to_string(),
×
60
    }
NEW
61
}
×
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