Skip to content

Commit

Permalink
refactor (#331)
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Jul 22, 2022
1 parent 8e5b796 commit a437abe
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 30 deletions.
12 changes: 6 additions & 6 deletions src/plumbing/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ pub fn main() -> Result<()> {
)
},
),
Subcommands::Revision { cmd } => match cmd {
Subcommands::Revision(cmd) => match cmd {
revision::Subcommands::Explain { spec } => prepare_and_run(
"repository-commit-describe",
verbose,
Expand All @@ -513,7 +513,7 @@ pub fn main() -> Result<()> {
move |_progress, out, _err| core::repository::revision::explain(repository()?.into(), spec, out),
),
},
Subcommands::Commit { cmd } => match cmd {
Subcommands::Commit(cmd) => match cmd {
commit::Subcommands::Describe {
annotated_tags,
all_refs,
Expand Down Expand Up @@ -548,7 +548,7 @@ pub fn main() -> Result<()> {
},
),
},
Subcommands::Tree { cmd } => match cmd {
Subcommands::Tree(cmd) => match cmd {
tree::Subcommands::Entries {
treeish,
recursive,
Expand Down Expand Up @@ -581,7 +581,7 @@ pub fn main() -> Result<()> {
},
),
},
Subcommands::Odb { cmd } => match cmd {
Subcommands::Odb(cmd) => match cmd {
odb::Subcommands::Entries => prepare_and_run(
"repository-odb-entries",
verbose,
Expand All @@ -599,7 +599,7 @@ pub fn main() -> Result<()> {
move |_progress, out, err| core::repository::odb::info(repository()?.into(), format, out, err),
),
},
Subcommands::Mailmap { cmd } => match cmd {
Subcommands::Mailmap(cmd) => match cmd {
mailmap::Subcommands::Entries => prepare_and_run(
"repository-mailmap-entries",
verbose,
Expand All @@ -609,7 +609,7 @@ pub fn main() -> Result<()> {
move |_progress, out, err| core::repository::mailmap::entries(repository()?.into(), format, out, err),
),
},
Subcommands::Exclude { cmd } => match cmd {
Subcommands::Exclude(cmd) => match cmd {
exclude::Subcommands::Query {
patterns,
pathspecs,
Expand Down
36 changes: 12 additions & 24 deletions src/plumbing/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,40 +52,28 @@ pub struct Args {
#[derive(Debug, clap::Subcommand)]
pub enum Subcommands {
/// Interact with the object database.
Odb {
#[clap(subcommand)]
cmd: odb::Subcommands,
},
#[clap(subcommand)]
Odb(odb::Subcommands),
/// Interact with tree objects.
Tree {
#[clap(subcommand)]
cmd: tree::Subcommands,
},
#[clap(subcommand)]
Tree(tree::Subcommands),
/// Interact with commit objects.
Commit {
#[clap(subcommand)]
cmd: commit::Subcommands,
},
#[clap(subcommand)]
Commit(commit::Subcommands),
/// Verify the integrity of the entire repository
Verify {
#[clap(flatten)]
args: free::pack::VerifyOptions,
},
/// Query and obtain information about revisions.
Revision {
#[clap(subcommand)]
cmd: revision::Subcommands,
},
#[clap(subcommand)]
Revision(revision::Subcommands),
/// Interact with the mailmap.
Mailmap {
#[clap(subcommand)]
cmd: mailmap::Subcommands,
},
#[clap(subcommand)]
Mailmap(mailmap::Subcommands),
/// Interact with the exclude files like .gitignore.
Exclude {
#[clap(subcommand)]
cmd: exclude::Subcommands,
},
#[clap(subcommand)]
Exclude(exclude::Subcommands),
/// Subcommands that need no git repository to run.
#[clap(subcommand)]
Free(free::Subcommands),
Expand Down

0 comments on commit a437abe

Please sign in to comment.