cli: rename SparseArgs to SparseCommand

This commit is contained in:
Yuya Nishihara 2024-06-20 16:47:10 +09:00
parent de022aeaa7
commit 026d83b61f
2 changed files with 8 additions and 8 deletions

View file

@ -137,7 +137,7 @@ enum Command {
Run(run::RunArgs), Run(run::RunArgs),
Show(show::ShowArgs), Show(show::ShowArgs),
#[command(subcommand)] #[command(subcommand)]
Sparse(sparse::SparseArgs), Sparse(sparse::SparseCommand),
Split(split::SplitArgs), Split(split::SplitArgs),
Squash(squash::SquashArgs), Squash(squash::SquashArgs),
Status(status::StatusArgs), Status(status::StatusArgs),

View file

@ -34,7 +34,7 @@ use crate::ui::Ui;
/// Manage which paths from the working-copy commit are present in the working /// Manage which paths from the working-copy commit are present in the working
/// copy /// copy
#[derive(Subcommand, Clone, Debug)] #[derive(Subcommand, Clone, Debug)]
pub(crate) enum SparseArgs { pub(crate) enum SparseCommand {
List(SparseListArgs), List(SparseListArgs),
Set(SparseSetArgs), Set(SparseSetArgs),
Reset(SparseResetArgs), Reset(SparseResetArgs),
@ -88,13 +88,13 @@ pub(crate) struct SparseEditArgs {}
pub(crate) fn cmd_sparse( pub(crate) fn cmd_sparse(
ui: &mut Ui, ui: &mut Ui,
command: &CommandHelper, command: &CommandHelper,
args: &SparseArgs, subcommand: &SparseCommand,
) -> Result<(), CommandError> { ) -> Result<(), CommandError> {
match args { match subcommand {
SparseArgs::List(sub_args) => cmd_sparse_list(ui, command, sub_args), SparseCommand::List(sub_args) => cmd_sparse_list(ui, command, sub_args),
SparseArgs::Set(sub_args) => cmd_sparse_set(ui, command, sub_args), SparseCommand::Set(sub_args) => cmd_sparse_set(ui, command, sub_args),
SparseArgs::Reset(sub_args) => cmd_sparse_reset(ui, command, sub_args), SparseCommand::Reset(sub_args) => cmd_sparse_reset(ui, command, sub_args),
SparseArgs::Edit(sub_args) => cmd_sparse_edit(ui, command, sub_args), SparseCommand::Edit(sub_args) => cmd_sparse_edit(ui, command, sub_args),
} }
} }