pub(crate) mod create;
pub(crate) mod info;
pub(crate) mod read;
pub(crate) mod write;
use anyhow::Result;
use clap::{Parser, Subcommand};
use crate::drive::client::DriveClient;
#[derive(Parser)]
pub struct DocsCommand {
#[command(subcommand)]
pub command: DocsSubcommands,
}
#[derive(Subcommand)]
pub enum DocsSubcommands {
Info(info::InfoCommand),
Read(read::ReadCommand),
Replace(write::ReplaceCommand),
Append(write::AppendCommand),
Create(create::CreateCommand),
}
impl DocsCommand {
pub async fn execute(self, client: &DriveClient) -> Result<()> {
match self.command {
DocsSubcommands::Info(cmd) => cmd.execute(client).await,
DocsSubcommands::Read(cmd) => cmd.execute(client).await,
DocsSubcommands::Replace(cmd) => cmd.execute(client).await,
DocsSubcommands::Append(cmd) => cmd.execute(client).await,
DocsSubcommands::Create(cmd) => cmd.execute(client).await,
}
}
}