Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Commit ac4fabb

Browse files
docs: add initial docs. for all binary args
1 parent 8ae6418 commit ac4fabb

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

src/main.rs

+26-4
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,16 @@ use git_glimpse::{git_config, list_branches_cmd, run, show_graph, stdout_lines};
88
///
99
/// When no arguments are specified, this commands runs as if the `stack` command was invoked
1010
/// with no arguments.
11+
///
12+
/// This binary has two optional points of Git configuration:
13+
///
14+
/// * `glimpse.base`: Sets the mainline branch. It is recommended that you use this only if
15+
/// this command does not correctly detect your mainline branch out-of-the-box.
16+
///
17+
/// * `glimpse.pretty`: The fallback value for the `--format` argument of this command.
1118
#[derive(Debug, Parser)]
1219
struct Args {
20+
/// Set the `--pretty` argument for underlying Git CLI calls.
1321
#[clap(long, short)]
1422
format: Option<String>,
1523
#[clap(subcommand)]
@@ -18,6 +26,11 @@ struct Args {
1826

1927
#[derive(Debug, Parser)]
2028
enum Subcommand {
29+
/// Select the current "stack" of commits.
30+
///
31+
/// A "stack" selection in this context includes the currently checked out branch and mainline
32+
/// branch. This is useful for day-to-day work, where you want only the commits relevant to
33+
/// what you're currently working on.
2134
Stack {
2235
#[clap(long, short)]
2336
base: Option<String>,
@@ -26,13 +39,22 @@ enum Subcommand {
2639
#[clap(flatten)]
2740
files: FileSelection,
2841
},
29-
/// Display local branches and, optionally, their upstreams.
42+
/// Select all local Git branches.
43+
///
44+
/// During typical work using Git, you may have several different "stacks" of work (see also
45+
/// the `stack` command). These tend to correspond to locally checked out branches. This
46+
/// command is useful for viewing all of them at the same time.
47+
///
48+
/// If the set of branches you'd like to work with is significantly smaller than this set of
49+
/// branches, this command might be too noisy for you. You may want to consider using a Git
50+
/// alias for a `select` command invocation instead.
3051
Locals {
3152
#[clap(flatten)]
3253
config: PresetConfig,
3354
#[clap(flatten)]
3455
files: FileSelection,
3556
},
57+
/// Select a custom set of commit-ish refs.
3658
Select {
3759
/// Additional branches to include.
3860
branches: Vec<String>,
@@ -43,13 +65,13 @@ enum Subcommand {
4365

4466
#[derive(Debug, Parser)]
4567
struct PresetConfig {
46-
/// Include all `@{upstream}` counterparts.
68+
/// Also include all `@{upstream}` counterparts to selected branches.
4769
#[clap(long = "upstreams", short = 'u')]
4870
select_upstreams: bool,
49-
/// Include all `@{push}` counterparts.
71+
/// Also select all `@{push}` counterparts to selected branches.
5072
#[clap(long = "pushes", short = 'p')]
5173
select_pushes: bool,
52-
/// Include the last tag that contains `HEAD`.
74+
/// Also select the last tag that contains `HEAD`.
5375
#[clap(long = "last-tag")]
5476
select_last_tag: bool,
5577
}

0 commit comments

Comments
 (0)