stub of CLI interface
This commit is contained in:
commit
9816809143
5 changed files with 288 additions and 0 deletions
33
src/main.rs
Normal file
33
src/main.rs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
use clap::{Parser, Subcommand};
|
||||
|
||||
#[derive(Subcommand)]
|
||||
pub enum Commands {
|
||||
Monitor,
|
||||
}
|
||||
|
||||
impl Commands {
|
||||
pub fn execute(self) {
|
||||
match self {
|
||||
Self::Monitor => {
|
||||
println!("[TODO] Power: ----W")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Parser)]
|
||||
pub struct Cli {
|
||||
#[command(subcommand)]
|
||||
command: Commands,
|
||||
}
|
||||
|
||||
impl Cli {
|
||||
pub fn execute(self) {
|
||||
self.command.execute();
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let cli = Cli::parse();
|
||||
cli.execute();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue