Complete skeleton dispatcher
- Complete the dispatcher for the 'introducer' and 'local' command. This is currently only a skeleton. - The 'introducer list' command is added.
This commit is contained in:
+52
-3
@@ -24,7 +24,7 @@ pub struct CliArgs {
|
||||
pub enum HuskSubcommands {
|
||||
Daemon(DaemonCommand),
|
||||
Introducer(IntroducerCommand),
|
||||
Local,
|
||||
Local(LocalCommand),
|
||||
}
|
||||
|
||||
// Daemon subcommands
|
||||
@@ -62,10 +62,10 @@ pub enum DaemonSubcommand {
|
||||
)]
|
||||
pub struct IntroducerCommand {
|
||||
#[clap(subcommand)]
|
||||
pub subcommand: IntroducerSubcommands,
|
||||
pub subcommand: IntroducerSubcommand,
|
||||
}
|
||||
#[derive(Debug, Subcommand)]
|
||||
pub enum IntroducerSubcommands {
|
||||
pub enum IntroducerSubcommand {
|
||||
Add(IntroducerAddCommand),
|
||||
Remove(IntroducerRemoveCommand),
|
||||
List
|
||||
@@ -105,3 +105,52 @@ pub struct IntroducerRemoveCommand {
|
||||
)]
|
||||
pub cert: String,
|
||||
}
|
||||
|
||||
// Local subcommands
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
#[clap(
|
||||
name = "local",
|
||||
about = "Manage manually added certificates.",
|
||||
subcommand_required = true,
|
||||
arg_required_else_help = true,
|
||||
disable_colored_help = true,
|
||||
disable_version_flag = true,
|
||||
)]
|
||||
pub struct LocalCommand {
|
||||
#[clap(subcommand)]
|
||||
pub subcommand: LocalSubcommand,
|
||||
}
|
||||
#[derive(Debug, Subcommand)]
|
||||
pub enum LocalSubcommand {
|
||||
Add(LocalAddCommand),
|
||||
Remove(LocalRemoveCommand),
|
||||
List
|
||||
}
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
#[clap(
|
||||
name = "local_add",
|
||||
about = "Add an authenticated certificate.",
|
||||
)]
|
||||
pub struct LocalAddCommand {
|
||||
#[clap(
|
||||
long = "cert",
|
||||
help = "Certificate to add."
|
||||
)]
|
||||
pub cert: String,
|
||||
}
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
#[clap(
|
||||
name = "local_remove",
|
||||
about = "Certificate to remove.",
|
||||
)]
|
||||
pub struct LocalRemoveCommand {
|
||||
#[clap(
|
||||
long = "cert",
|
||||
help = "Certificate to removed."
|
||||
)]
|
||||
pub cert: String,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user