Skip to content

Commit

Permalink
frame for gix repo rev explain (#427)
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Jun 14, 2022
1 parent 2c3491e commit 12e6277
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/plumbing/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ pub fn main() -> Result<()> {
use git_repository as git;
let repository = git::ThreadSafeRepository::discover(repository)?;
match cmd {
repo::Subcommands::Revision { cmd } => match cmd {
repo::revision::Subcommands::Explain { spec: _ } => todo!("describe spec"),
},
repo::Subcommands::Commit { cmd } => match cmd {
repo::commit::Subcommands::Describe {
annotated_tags,
Expand Down
16 changes: 15 additions & 1 deletion src/plumbing/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ pub mod repo {
}

#[derive(Debug, clap::Subcommand)]
#[clap(alias = "repo")]
#[clap(visible_alias = "repo")]
pub enum Subcommands {
/// Verify the integrity of the entire repository
Verify {
Expand Down Expand Up @@ -375,6 +375,20 @@ pub mod repo {
#[clap(subcommand)]
cmd: exclude::Subcommands,
},
/// Query and obtain information about revisions.
Revision {
#[clap(subcommand)]
cmd: revision::Subcommands,
},
}

pub mod revision {
#[derive(Debug, clap::Subcommand)]
#[clap(visible_alias = "rev")]
pub enum Subcommands {
/// Provide the revision specification like `@~1` to explain.
Explain { spec: std::ffi::OsString },
}
}

pub mod exclude {
Expand Down
3 changes: 2 additions & 1 deletion src/porcelain/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ pub enum ToolCommands {
about = "Estimate hours worked based on a commit history",
long_about = "See https://github.com/kimmobrunfeldt/git-hours#how-it-works for details",
version = clap::crate_version!(),
visible_alias = "h")
visible_alias = "h",
visible_alias = "hours")
]
pub struct EstimateHours {
/// The directory containing a '.git/' folder.
Expand Down

0 comments on commit 12e6277

Please sign in to comment.