From e509a299e597d3dec154723d9f8ff18dc089e5d2 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Mon, 6 Mar 2023 20:22:59 -0800 Subject: [PATCH] cli: print commands in alphabetical order Until https://github.com/clap-rs/clap/issues/1553 is fixed, I don't think we can do better than alphabetical order (without a lot of work). --- src/commands/mod.rs | 66 ++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/commands/mod.rs b/src/commands/mod.rs index 1e511a91a9..55112955fa 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -64,34 +64,29 @@ use crate::ui::Ui; #[derive(clap::Parser, Clone, Debug)] enum Commands { - Version(VersionArgs), - Init(InitArgs), + Abandon(AbandonArgs), + Backout(BackoutArgs), #[command(subcommand)] - Config(ConfigSubcommand), - Checkout(CheckoutArgs), - Untrack(UntrackArgs), - Files(FilesArgs), + Branch(branch::BranchSubcommand), #[command(alias = "print")] Cat(CatArgs), - Diff(DiffArgs), - Show(ShowArgs), - Status(StatusArgs), - Log(LogArgs), - Obslog(ObslogArgs), - Interdiff(InterdiffArgs), - Describe(DescribeArgs), + Checkout(CheckoutArgs), Commit(CommitArgs), + #[command(subcommand)] + Config(ConfigSubcommand), + #[command(subcommand)] + Debug(DebugCommands), + Describe(DescribeArgs), + Diff(DiffArgs), + Diffedit(DiffeditArgs), Duplicate(DuplicateArgs), - Abandon(AbandonArgs), Edit(EditArgs), - New(NewArgs), - Move(MoveArgs), - Squash(SquashArgs), - Unsquash(UnsquashArgs), - Restore(RestoreArgs), - Diffedit(DiffeditArgs), - Resolve(ResolveArgs), - Split(SplitArgs), + Files(FilesArgs), + #[command(subcommand)] + Git(git::GitCommands), + Init(InitArgs), + Interdiff(InterdiffArgs), + Log(LogArgs), /// Merge work from multiple branches /// /// Unlike most other VCSs, `jj merge` does not implicitly include the @@ -102,22 +97,27 @@ enum Commands { /// This is the same as `jj new`, except that it requires at least two /// arguments. Merge(NewArgs), - Rebase(RebaseArgs), - Backout(BackoutArgs), - #[command(subcommand)] - Branch(branch::BranchSubcommand), - /// Undo an operation (shortcut for `jj op undo`) - Undo(operation::OperationUndoArgs), + Move(MoveArgs), + New(NewArgs), + Obslog(ObslogArgs), #[command(subcommand)] #[command(visible_alias = "op")] Operation(operation::OperationCommands), - #[command(subcommand)] - Workspace(WorkspaceCommands), + Rebase(RebaseArgs), + Resolve(ResolveArgs), + Restore(RestoreArgs), + Show(ShowArgs), Sparse(SparseArgs), + Split(SplitArgs), + Squash(SquashArgs), + Status(StatusArgs), + /// Undo an operation (shortcut for `jj op undo`) + Undo(operation::OperationUndoArgs), + Unsquash(UnsquashArgs), + Untrack(UntrackArgs), + Version(VersionArgs), #[command(subcommand)] - Git(git::GitCommands), - #[command(subcommand)] - Debug(DebugCommands), + Workspace(WorkspaceCommands), } /// Display version information