Coverage Report

Created: 2026-07-21 00:46

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
super-stt-cosmic-applet/src/main.rs
Line
Count
Source
1
// SPDX-License-Identifier: GPL-3.0-only
2
use clap::{Arg, Command, ValueEnum};
3
use super_stt_cosmic_applet::{VERSION, VisualizationSide};
4
5
#[derive(ValueEnum, Clone, Debug)]
6
enum Side {
7
    Full,
8
    Left,
9
    Right,
10
}
11
12
impl From<Side> for VisualizationSide {
13
0
    fn from(side: Side) -> Self {
14
0
        match side {
15
0
            Side::Full => VisualizationSide::Full,
16
0
            Side::Left => VisualizationSide::Left,
17
0
            Side::Right => VisualizationSide::Right,
18
        }
19
0
    }
20
}
21
22
0
fn main() -> cosmic::iced::Result {
23
    // `Info` default (the bare `env_logger::init()` here defaulted to `error`,
24
    // making the applet effectively silent vs its siblings) (Tier 2 #6).
25
0
    super_stt_shared::logging::init();
26
0
    log::info!("Starting Super STT applet with version {VERSION}");
27
28
0
    let matches = Command::new("super-stt-cosmic-applet")
29
0
        .version(VERSION)
30
0
        .about("COSMIC panel applet for Super STT speech-to-text service")
31
0
        .arg(
32
0
            Arg::new("side")
33
0
                .long("side")
34
0
                .short('s')
35
0
                .help("Visualization side to display")
36
0
                .value_parser(clap::value_parser!(Side))
37
0
                .default_value("full"),
38
        )
39
0
        .get_matches();
40
41
0
    let side = matches.get_one::<Side>("side").unwrap().clone();
42
0
    let visualization_side = VisualizationSide::from(side);
43
44
0
    cosmic::applet::run::<super_stt_cosmic_applet::SuperSttApplet>(visualization_side)
45
0
}