mirror of
https://github.com/martinvonz/jj.git
synced 2024-11-24 15:18:53 +00:00
cli: bench: place command dispatcher function closer to enum definition
This commit is contained in:
parent
0ae282180a
commit
541376b944
1 changed files with 13 additions and 13 deletions
|
@ -50,6 +50,19 @@ pub enum BenchCommand {
|
|||
Revset(BenchRevsetArgs),
|
||||
}
|
||||
|
||||
pub(crate) fn cmd_bench(
|
||||
ui: &mut Ui,
|
||||
command: &CommandHelper,
|
||||
subcommand: &BenchCommand,
|
||||
) -> Result<(), CommandError> {
|
||||
match subcommand {
|
||||
BenchCommand::CommonAncestors(args) => cmd_bench_common_ancestors(ui, command, args),
|
||||
BenchCommand::IsAncestor(args) => cmd_bench_is_ancestor(ui, command, args),
|
||||
BenchCommand::ResolvePrefix(args) => cmd_bench_resolve_prefix(ui, command, args),
|
||||
BenchCommand::Revset(args) => cmd_bench_revset(ui, command, args),
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(clap::Args, Clone, Debug)]
|
||||
struct CriterionArgs {
|
||||
/// Name of baseline to save results
|
||||
|
@ -94,16 +107,3 @@ where
|
|||
});
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(crate) fn cmd_bench(
|
||||
ui: &mut Ui,
|
||||
command: &CommandHelper,
|
||||
subcommand: &BenchCommand,
|
||||
) -> Result<(), CommandError> {
|
||||
match subcommand {
|
||||
BenchCommand::CommonAncestors(args) => cmd_bench_common_ancestors(ui, command, args),
|
||||
BenchCommand::IsAncestor(args) => cmd_bench_is_ancestor(ui, command, args),
|
||||
BenchCommand::ResolvePrefix(args) => cmd_bench_resolve_prefix(ui, command, args),
|
||||
BenchCommand::Revset(args) => cmd_bench_revset(ui, command, args),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue