mirror of
https://github.com/RGBCube/superfreq
synced 2025-07-29 01:47:44 +00:00
xtask: add completion generation
This commit is contained in:
parent
a341d08c45
commit
0e07241280
6 changed files with 147 additions and 17 deletions
17
watt/lib.rs
17
watt/lib.rs
|
@ -27,9 +27,8 @@ pub enum Command {
|
|||
#[command(flatten)]
|
||||
verbosity: clap_verbosity_flag::Verbosity,
|
||||
|
||||
/// The daemon config path.
|
||||
#[arg(long, env = "WATT_CONFIG")]
|
||||
config: Option<PathBuf>,
|
||||
#[clap(flatten)]
|
||||
command: WattCommand,
|
||||
},
|
||||
|
||||
/// CPU metadata and modification utility.
|
||||
|
@ -51,6 +50,13 @@ pub enum Command {
|
|||
},
|
||||
}
|
||||
|
||||
#[derive(clap::Parser, Debug)]
|
||||
pub struct WattCommand {
|
||||
/// The daemon config path.
|
||||
#[arg(long, env = "WATT_CONFIG")]
|
||||
config: Option<PathBuf>,
|
||||
}
|
||||
|
||||
#[derive(clap::Parser, Debug)]
|
||||
pub enum CpuCommand {
|
||||
/// Modify CPU attributes.
|
||||
|
@ -79,7 +85,10 @@ pub fn main() -> anyhow::Result<()> {
|
|||
.init();
|
||||
|
||||
match cli.command {
|
||||
Command::Watt { config, .. } => {
|
||||
Command::Watt {
|
||||
command: WattCommand { config },
|
||||
..
|
||||
} => {
|
||||
let config = config::DaemonConfig::load_from(config.as_deref())
|
||||
.context("failed to load daemon config")?;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue