ok/jj
1
0
Fork 0
forked from mirrors/jj

Renaming \'BranchSubCommand\' and \'ConfigSubCommand\'

This commit is contained in:
Daehyeok Mun 2024-01-22 09:18:47 -08:00 committed by Daehyeok Mun
parent 02f94653e6
commit ad05a8750a
3 changed files with 18 additions and 18 deletions

View file

@ -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),
}
}

View file

@ -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),
}
}

View file

@ -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),