Skip to content

Commit

Permalink
refactor: improve help text for revision-range, default to HEAD
Browse files Browse the repository at this point in the history
Just took the text help from `man git-shortlog` on `<revision-range>`,
since that is exactly where it is being called.
  • Loading branch information
lukehsiao committed Oct 29, 2022
1 parent 267a28f commit 6bf71a0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@ cargo install git-stats --locked
## Usage

```
Usage: git-stats [OPTIONS] <REV_RANGE>
$ git stats -h
A script for grabbing more thorough shortlog stats
Usage: git-stats [OPTIONS] [revision-range]
Arguments:
<REV_RANGE> The revision range to consider
[revision-range] Show only commits in the specified revision range [default: HEAD]
Options:
-v, --verbose... More output per occurrence
-q, --quiet... Less output per occurrence
-h, --help Print help information
-h, --help Print help information (use `--help` for more detail)
-V, --version Print version information
```
8 changes: 7 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ use xshell::{cmd, Shell};
#[derive(Parser)]
#[command(author, version, about, long_about = None)]
struct Cli {
/// The revision range to consider
#[arg(name = "revision-range", default_value = "HEAD")]
/// Show only commits in the specified revision range.
///
/// When no <revision-range> is specified, it defaults to HEAD (i.e. the whole history leading
/// to the current commit). origin..HEAD specifies all the commits reachable from the current
/// commit (i.e. HEAD), but not from origin. For a complete list of ways to spell
/// [revision-range], see the "Specifying Ranges" section of gitrevisions(7).
rev_range: String,
#[command(flatten)]
verbose: Verbosity<WarnLevel>,
Expand Down

0 comments on commit 6bf71a0

Please sign in to comment.