mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-18 18:27:38 +00:00
cli: make aliases (for commands and arguments) visible in help
This should help make e.g. `squash` discoverable for users who search the help output for "amend". It should also help users discover the builtin abbreviations like `st` (for `status`).
This commit is contained in:
parent
cbe370fdd9
commit
f5f3091997
2 changed files with 9 additions and 9 deletions
|
@ -1098,7 +1098,7 @@ struct GlobalArgs {
|
||||||
/// but it is possible.
|
/// but it is possible.
|
||||||
#[clap(
|
#[clap(
|
||||||
long,
|
long,
|
||||||
alias = "at-op",
|
visible_alias = "at-op",
|
||||||
global = true,
|
global = true,
|
||||||
help_heading = "GLOBAL OPTIONS",
|
help_heading = "GLOBAL OPTIONS",
|
||||||
default_value = "@"
|
default_value = "@"
|
||||||
|
@ -1172,7 +1172,7 @@ struct InitArgs {
|
||||||
/// be created on top, and that will be checked out. For more information, see
|
/// be created on top, and that will be checked out. For more information, see
|
||||||
/// https://github.com/martinvonz/jj/blob/main/docs/working-copy.md.
|
/// https://github.com/martinvonz/jj/blob/main/docs/working-copy.md.
|
||||||
#[derive(clap::Args, Clone, Debug)]
|
#[derive(clap::Args, Clone, Debug)]
|
||||||
#[clap(alias = "co")]
|
#[clap(visible_alias = "co")]
|
||||||
struct CheckoutArgs {
|
struct CheckoutArgs {
|
||||||
/// The revision to update to
|
/// The revision to update to
|
||||||
revision: String,
|
revision: String,
|
||||||
|
@ -1267,7 +1267,7 @@ struct ShowArgs {
|
||||||
///
|
///
|
||||||
/// * Conflicted branches (see https://github.com/martinvonz/jj/blob/main/docs/branches.md)
|
/// * Conflicted branches (see https://github.com/martinvonz/jj/blob/main/docs/branches.md)
|
||||||
#[derive(clap::Args, Clone, Debug)]
|
#[derive(clap::Args, Clone, Debug)]
|
||||||
#[clap(alias = "st")]
|
#[clap(visible_alias = "st")]
|
||||||
struct StatusArgs {}
|
struct StatusArgs {}
|
||||||
|
|
||||||
/// Show commit history
|
/// Show commit history
|
||||||
|
@ -1335,7 +1335,7 @@ struct DescribeArgs {
|
||||||
/// For information about open/closed revisions, see
|
/// For information about open/closed revisions, see
|
||||||
/// https://github.com/martinvonz/jj/blob/main/docs/working-copy.md.
|
/// https://github.com/martinvonz/jj/blob/main/docs/working-copy.md.
|
||||||
#[derive(clap::Args, Clone, Debug)]
|
#[derive(clap::Args, Clone, Debug)]
|
||||||
#[clap(alias = "commit")]
|
#[clap(visible_alias = "commit")]
|
||||||
struct CloseArgs {
|
struct CloseArgs {
|
||||||
/// The revision to close
|
/// The revision to close
|
||||||
#[clap(default_value = "@")]
|
#[clap(default_value = "@")]
|
||||||
|
@ -1353,7 +1353,7 @@ struct CloseArgs {
|
||||||
/// For information about open/closed revisions,
|
/// For information about open/closed revisions,
|
||||||
/// see https://github.com/martinvonz/jj/blob/main/docs/working-copy.md.
|
/// see https://github.com/martinvonz/jj/blob/main/docs/working-copy.md.
|
||||||
#[derive(clap::Args, Clone, Debug)]
|
#[derive(clap::Args, Clone, Debug)]
|
||||||
#[clap(alias = "uncommit")]
|
#[clap(visible_alias = "uncommit")]
|
||||||
struct OpenArgs {
|
struct OpenArgs {
|
||||||
/// The revision to open
|
/// The revision to open
|
||||||
revision: String,
|
revision: String,
|
||||||
|
@ -1433,7 +1433,7 @@ struct MoveArgs {
|
||||||
/// compared to its parent, it will be abandoned. This will always be the case
|
/// compared to its parent, it will be abandoned. This will always be the case
|
||||||
/// without `--interactive`.
|
/// without `--interactive`.
|
||||||
#[derive(clap::Args, Clone, Debug)]
|
#[derive(clap::Args, Clone, Debug)]
|
||||||
#[clap(alias = "amend")]
|
#[clap(visible_alias = "amend")]
|
||||||
struct SquashArgs {
|
struct SquashArgs {
|
||||||
#[clap(long, short, default_value = "@")]
|
#[clap(long, short, default_value = "@")]
|
||||||
revision: String,
|
revision: String,
|
||||||
|
@ -1447,7 +1447,7 @@ struct SquashArgs {
|
||||||
|
|
||||||
/// Move changes from a revision's parent into the revision
|
/// Move changes from a revision's parent into the revision
|
||||||
#[derive(clap::Args, Clone, Debug)]
|
#[derive(clap::Args, Clone, Debug)]
|
||||||
#[clap(alias = "unamend")]
|
#[clap(visible_alias = "unamend")]
|
||||||
struct UnsquashArgs {
|
struct UnsquashArgs {
|
||||||
#[clap(long, short, default_value = "@")]
|
#[clap(long, short, default_value = "@")]
|
||||||
revision: String,
|
revision: String,
|
||||||
|
@ -1658,7 +1658,7 @@ struct BranchesArgs {}
|
||||||
/// Commands for working with the operation log. For information about the
|
/// Commands for working with the operation log. For information about the
|
||||||
/// operation log, see https://github.com/martinvonz/jj/blob/main/docs/operation-log.md.
|
/// operation log, see https://github.com/martinvonz/jj/blob/main/docs/operation-log.md.
|
||||||
#[derive(clap::Args, Clone, Debug)]
|
#[derive(clap::Args, Clone, Debug)]
|
||||||
#[clap(alias = "op")]
|
#[clap(visible_alias = "op")]
|
||||||
struct OperationArgs {
|
struct OperationArgs {
|
||||||
#[clap(subcommand)]
|
#[clap(subcommand)]
|
||||||
command: OperationCommands,
|
command: OperationCommands,
|
||||||
|
|
|
@ -147,7 +147,7 @@ fn test_help() {
|
||||||
-r, --revision <REVISION> The revision to edit [default: @]
|
-r, --revision <REVISION> The revision to edit [default: @]
|
||||||
|
|
||||||
GLOBAL OPTIONS:
|
GLOBAL OPTIONS:
|
||||||
--at-operation <AT_OPERATION> Operation to load the repo at [default: @]
|
--at-operation <AT_OPERATION> Operation to load the repo at [default: @] [aliases: at-op]
|
||||||
-h, --help Print help information, more help with --help than with -h
|
-h, --help Print help information, more help with --help than with -h
|
||||||
--no-commit-working-copy Don't commit the working copy
|
--no-commit-working-copy Don't commit the working copy
|
||||||
-R, --repository <REPOSITORY> Path to repository to operate on
|
-R, --repository <REPOSITORY> Path to repository to operate on
|
||||||
|
|
Loading…
Reference in a new issue