Add printing, commands work

This commit is contained in:
2026-07-03 18:45:33 +03:00
parent 16615d32c1
commit 6537c41972
8 changed files with 402 additions and 63 deletions

View File

@@ -1,4 +1,5 @@
use clap::ArgGroup;
use serde::de;
#[derive(Debug, Clone, clap::Parser, Default)]
pub struct CliArgs {
@@ -34,6 +35,9 @@ pub enum CliCommand {
/// Command to run
#[arg(long, short = 'c')]
command: String,
/// Output format
#[arg(long, short = 'f')]
format: OutputFormat,
},
/// Run command continuosly
#[command(
@@ -53,8 +57,11 @@ pub enum CliCommand {
/// Command to run
#[arg(long, short = 'c')]
command: String,
#[arg(long, short = 'i')]
/// Output format
#[arg(long, short = 'f')]
format: OutputFormat,
/// Interval to run the commands at
#[arg(long, short = 'i')]
interval: f32,
},
/// Manage devices
@@ -77,3 +84,11 @@ pub enum CliDeviceCommand {
#[clap(skip)]
None,
}
#[derive(Clone, Debug, Default, clap::ValueEnum)]
pub enum OutputFormat {
#[default]
Csv,
Table,
Json,
}