xps 13 3980
This commit is contained in:
60
src/cli.rs
Normal file
60
src/cli.rs
Normal file
@@ -0,0 +1,60 @@
|
||||
use clap::{Parser, builder::styling};
|
||||
use std::path::PathBuf;
|
||||
|
||||
const STYLES: styling::Styles = styling::Styles::styled()
|
||||
.header(styling::AnsiColor::Green.on_default().bold())
|
||||
.usage(styling::AnsiColor::Green.on_default().bold())
|
||||
.literal(styling::AnsiColor::Cyan.on_default().bold())
|
||||
.placeholder(styling::AnsiColor::Cyan.on_default());
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
#[command(
|
||||
name = "ember-tune",
|
||||
author = "Nils Pukropp <nils@narl.io>",
|
||||
version = "1.0.0",
|
||||
about = "ember-tune: Scientifically-driven hardware power and thermal optimizer.",
|
||||
long_about = "ember-tune transforms manual laptop tuning into a rigorous, automated engineering workflow. \nIt executes a state machine to find the 'Physical Sweet Spot' of your specific hardware by measuring \nthe Silicon Knee, Thermal Resistance (Rθ), and Thermal Inertia, then outputs optimal \nconfigurations for tools like 'throttled' or 'ryzenadj'.",
|
||||
styles = STYLES,
|
||||
after_help = "EXAMPLES:\n sudo ember-tune run # Run standard optimization\n sudo ember-tune run --dry-run # Audit and simulate without changes\n sudo ember-tune run --mock # Safe demo with fake hardware"
|
||||
)]
|
||||
pub struct Cli {
|
||||
/// Path to output the optimized configuration file
|
||||
#[arg(
|
||||
short,
|
||||
long,
|
||||
default_value = "throttled.conf",
|
||||
help = "Destination for the generated configuration file (e.g. /etc/throttled.conf)"
|
||||
)]
|
||||
pub config_out: PathBuf,
|
||||
|
||||
/// Maximum safe temperature (Celsius) for the benchmark
|
||||
#[arg(
|
||||
short,
|
||||
long,
|
||||
default_value_t = 95.0,
|
||||
help = "The emergency thermal cutoff. If any sensor hits this, the benchmark aborts instantly."
|
||||
)]
|
||||
pub max_temp: f32,
|
||||
|
||||
/// Enable verbose debug logging
|
||||
#[arg(
|
||||
short,
|
||||
long,
|
||||
help = "Writes high-resolution diagnostic logs to /tmp/ember-tune.log"
|
||||
)]
|
||||
pub verbose: bool,
|
||||
|
||||
/// Use a mock hardware layer for safe testing
|
||||
#[arg(
|
||||
long,
|
||||
help = "Emulates hardware responses. Ideal for testing UI/Logic on unsupported systems."
|
||||
)]
|
||||
pub mock: bool,
|
||||
|
||||
/// Run pre-flight audit only
|
||||
#[arg(
|
||||
long,
|
||||
help = "Validate system requirements and conflict management without starting the benchmark."
|
||||
)]
|
||||
pub audit_only: bool,
|
||||
}
|
||||
Reference in New Issue
Block a user