Owo
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user