This commit is contained in:
2026-07-07 17:19:25 +03:00
parent 14c0009030
commit fbef11dfe7
4 changed files with 74 additions and 10 deletions

View File

@@ -7,6 +7,8 @@
* permission.
*/
use std::net::IpAddr;
use clap::ArgGroup;
use serde::de;
@@ -25,9 +27,13 @@ pub struct CliArgs {
pub config_file: camino::Utf8PathBuf,
/// Output more information in logs
#[arg(long = "verbose", short = 'v')]
#[arg(long = "verbose", short = 'v', conflicts_with="quiet")]
pub verbose: bool,
/// Output more information in logs
#[arg(long = "quiet", short = 'q', conflicts_with="verbose")]
pub quiet: bool,
#[command(subcommand)]
pub command: CliCommand,
}
@@ -96,7 +102,28 @@ pub enum CliCommand {
pub enum CliDeviceCommand {
/// List devices
List,
Add {
/// Device name
#[arg(short='n', long)]
name: String,
/// Device address, ipv4 or ipv6
#[arg(short='H', long)]
host: IpAddr,
/// Device Port (skip for default)
#[arg(short='p', long)]
port: Option<u16>,
/// Username (skip for default)
#[arg(short='U', long)]
username: Option<String>,
/// Password (skip for default)
#[arg(short='P', long)]
password: Option<String>
},
Remove {
/// Name of the device
#[arg(short, long)]
name: String,
},
#[default]
#[clap(skip)]
None,