From ad05a8750a8c3cedd16f58d122e9476416ab3104 Mon Sep 17 00:00:00 2001 From: Daehyeok Mun Date: Mon, 22 Jan 2024 09:18:47 -0800 Subject: [PATCH] Renaming \'BranchSubCommand\' and \'ConfigSubCommand\' --- cli/src/commands/branch.rs | 20 ++++++++++---------- cli/src/commands/config.rs | 12 ++++++------ cli/src/commands/mod.rs | 4 ++-- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/cli/src/commands/branch.rs b/cli/src/commands/branch.rs index ba08a9650..52c8b8010 100644 --- a/cli/src/commands/branch.rs +++ b/cli/src/commands/branch.rs @@ -39,7 +39,7 @@ use crate::ui::Ui; /// For information about branches, see /// https://github.com/martinvonz/jj/blob/main/docs/branches.md. #[derive(clap::Subcommand, Clone, Debug)] -pub enum BranchSubcommand { +pub enum BranchCommand { #[command(visible_alias("c"))] Create(BranchCreateArgs), #[command(visible_alias("d"))] @@ -212,17 +212,17 @@ fn make_branch_term(branch_names: &[impl fmt::Display]) -> String { pub fn cmd_branch( ui: &mut Ui, command: &CommandHelper, - subcommand: &BranchSubcommand, + subcommand: &BranchCommand, ) -> Result<(), CommandError> { match subcommand { - BranchSubcommand::Create(sub_args) => cmd_branch_create(ui, command, sub_args), - BranchSubcommand::Rename(sub_args) => cmd_branch_rename(ui, command, sub_args), - BranchSubcommand::Set(sub_args) => cmd_branch_set(ui, command, sub_args), - BranchSubcommand::Delete(sub_args) => cmd_branch_delete(ui, command, sub_args), - BranchSubcommand::Forget(sub_args) => cmd_branch_forget(ui, command, sub_args), - BranchSubcommand::Track(sub_args) => cmd_branch_track(ui, command, sub_args), - BranchSubcommand::Untrack(sub_args) => cmd_branch_untrack(ui, command, sub_args), - BranchSubcommand::List(sub_args) => cmd_branch_list(ui, command, sub_args), + BranchCommand::Create(sub_args) => cmd_branch_create(ui, command, sub_args), + BranchCommand::Rename(sub_args) => cmd_branch_rename(ui, command, sub_args), + BranchCommand::Set(sub_args) => cmd_branch_set(ui, command, sub_args), + BranchCommand::Delete(sub_args) => cmd_branch_delete(ui, command, sub_args), + BranchCommand::Forget(sub_args) => cmd_branch_forget(ui, command, sub_args), + BranchCommand::Track(sub_args) => cmd_branch_track(ui, command, sub_args), + BranchCommand::Untrack(sub_args) => cmd_branch_untrack(ui, command, sub_args), + BranchCommand::List(sub_args) => cmd_branch_list(ui, command, sub_args), } } diff --git a/cli/src/commands/config.rs b/cli/src/commands/config.rs index 467bdd759..513748c3b 100644 --- a/cli/src/commands/config.rs +++ b/cli/src/commands/config.rs @@ -58,7 +58,7 @@ impl ConfigArgs { /// For file locations, supported config options, and other details about jj /// config, see https://github.com/martinvonz/jj/blob/main/docs/config.md. #[derive(clap::Subcommand, Clone, Debug)] -pub(crate) enum ConfigSubcommand { +pub(crate) enum ConfigCommand { #[command(visible_alias("l"))] List(ConfigListArgs), #[command(visible_alias("g"))] @@ -142,13 +142,13 @@ pub(crate) struct ConfigEditArgs { pub(crate) fn cmd_config( ui: &mut Ui, command: &CommandHelper, - subcommand: &ConfigSubcommand, + subcommand: &ConfigCommand, ) -> Result<(), CommandError> { match subcommand { - ConfigSubcommand::List(sub_args) => cmd_config_list(ui, command, sub_args), - ConfigSubcommand::Get(sub_args) => cmd_config_get(ui, command, sub_args), - ConfigSubcommand::Set(sub_args) => cmd_config_set(ui, command, sub_args), - ConfigSubcommand::Edit(sub_args) => cmd_config_edit(ui, command, sub_args), + ConfigCommand::List(sub_args) => cmd_config_list(ui, command, sub_args), + ConfigCommand::Get(sub_args) => cmd_config_get(ui, command, sub_args), + ConfigCommand::Set(sub_args) => cmd_config_set(ui, command, sub_args), + ConfigCommand::Edit(sub_args) => cmd_config_edit(ui, command, sub_args), } } diff --git a/cli/src/commands/mod.rs b/cli/src/commands/mod.rs index 69d8e1a2e..03c43d37c 100644 --- a/cli/src/commands/mod.rs +++ b/cli/src/commands/mod.rs @@ -72,14 +72,14 @@ enum Command { #[command(subcommand)] Bench(bench::BenchCommand), #[command(subcommand)] - Branch(branch::BranchSubcommand), + Branch(branch::BranchCommand), #[command(alias = "print")] Cat(cat::CatArgs), Checkout(checkout::CheckoutArgs), Chmod(chmod::ChmodArgs), Commit(commit::CommitArgs), #[command(subcommand)] - Config(config::ConfigSubcommand), + Config(config::ConfigCommand), #[command(subcommand)] Debug(debug::DebugCommand), Describe(describe::DescribeArgs),