use std::io::Write;
use clap::{Args, Subcommand};
mod attest;
mod delegate;
use attest::AttestArgs;
use delegate::DelegateArgs;
#[derive(Debug, Args)]
pub(super) struct IdentityArgs {
#[command(subcommand)]
command: IdentityCommand,
}
#[derive(Debug, Subcommand)]
enum IdentityCommand {
Delegate(DelegateArgs),
Attest(AttestArgs),
}
pub(super) fn run(
args: IdentityArgs,
stdout: &mut dyn Write,
stderr: &mut dyn Write,
) -> Result<(), Box<dyn std::error::Error>> {
match args.command {
IdentityCommand::Delegate(args) => {
tracing::debug!(command = "identity.delegate", "command_start");
delegate::run(args, stdout, stderr)
}
IdentityCommand::Attest(args) => {
tracing::debug!(command = "identity.attest", "command_start");
attest::run(args, stdout, stderr)
}
}
}