mod annotate;
mod chmod;
mod list;
mod search;
mod show;
mod track;
mod untrack;
use crate::cli_util::CommandHelper;
use crate::command_error::CommandError;
use crate::ui::Ui;
#[derive(clap::Subcommand, Clone, Debug)]
pub enum FileCommand {
Annotate(annotate::FileAnnotateArgs),
Chmod(chmod::FileChmodArgs),
List(list::FileListArgs),
Search(search::FileSearchArgs),
Show(show::FileShowArgs),
Track(track::FileTrackArgs),
Untrack(untrack::FileUntrackArgs),
}
pub async fn cmd_file(
ui: &mut Ui,
command: &CommandHelper,
subcommand: &FileCommand,
) -> Result<(), CommandError> {
match subcommand {
FileCommand::Annotate(args) => annotate::cmd_file_annotate(ui, command, args).await,
FileCommand::Chmod(args) => chmod::cmd_file_chmod(ui, command, args).await,
FileCommand::List(args) => list::cmd_file_list(ui, command, args).await,
FileCommand::Search(args) => search::cmd_file_search(ui, command, args).await,
FileCommand::Show(args) => show::cmd_file_show(ui, command, args).await,
FileCommand::Track(args) => track::cmd_file_track(ui, command, args).await,
FileCommand::Untrack(args) => untrack::cmd_file_untrack(ui, command, args).await,
}
}