use clap::{Args, Subcommand};
pub use create::CreateCommand;
pub(crate) use delete::DeleteCommand;
pub(crate) use list::ListCommand;
pub(crate) use show::ShowCommand;
use crate::identity::default::DefaultCommand;
use crate::{docs, CommandGlobalOpts};
mod create;
mod default;
mod delete;
mod list;
mod show;
const LONG_ABOUT: &str = include_str!("./static/long_about.txt");
#[derive(Clone, Debug, Args)]
#[command(
arg_required_else_help = true,
subcommand_required = true,
long_about = docs::about(LONG_ABOUT),
)]
pub struct IdentityCommand {
#[command(subcommand)]
subcommand: IdentitySubcommand,
}
#[derive(Clone, Debug, Subcommand)]
pub enum IdentitySubcommand {
Create(CreateCommand),
Show(ShowCommand),
List(ListCommand),
Default(DefaultCommand),
Delete(DeleteCommand),
}
impl IdentityCommand {
pub fn run(self, options: CommandGlobalOpts) {
match self.subcommand {
IdentitySubcommand::Create(c) => c.run(options),
IdentitySubcommand::Show(c) => c.run(options),
IdentitySubcommand::List(c) => c.run(options),
IdentitySubcommand::Delete(c) => c.run(options),
IdentitySubcommand::Default(c) => c.run(options),
}
}
}