mirror of
https://github.com/martinvonz/jj.git
synced 2024-12-27 06:27:43 +00:00
cli: sort config/sparse subcommands in lexicographical order
This commit is contained in:
parent
78dba90ac8
commit
adcd78a0b7
3 changed files with 86 additions and 86 deletions
|
@ -63,16 +63,16 @@ impl ConfigLevelArgs {
|
|||
/// config, see https://github.com/martinvonz/jj/blob/main/docs/config.md.
|
||||
#[derive(clap::Subcommand, Clone, Debug)]
|
||||
pub(crate) enum ConfigCommand {
|
||||
#[command(visible_alias("l"))]
|
||||
List(ConfigListArgs),
|
||||
#[command(visible_alias("g"))]
|
||||
Get(ConfigGetArgs),
|
||||
#[command(visible_alias("s"))]
|
||||
Set(ConfigSetArgs),
|
||||
#[command(visible_alias("e"))]
|
||||
Edit(ConfigEditArgs),
|
||||
#[command(visible_alias("g"))]
|
||||
Get(ConfigGetArgs),
|
||||
#[command(visible_alias("l"))]
|
||||
List(ConfigListArgs),
|
||||
#[command(visible_alias("p"))]
|
||||
Path(ConfigPathArgs),
|
||||
#[command(visible_alias("s"))]
|
||||
Set(ConfigSetArgs),
|
||||
}
|
||||
|
||||
/// List variables set in config file, along with their values.
|
||||
|
@ -158,11 +158,11 @@ pub(crate) fn cmd_config(
|
|||
subcommand: &ConfigCommand,
|
||||
) -> Result<(), CommandError> {
|
||||
match subcommand {
|
||||
ConfigCommand::List(args) => cmd_config_list(ui, command, args),
|
||||
ConfigCommand::Get(args) => cmd_config_get(ui, command, args),
|
||||
ConfigCommand::Set(args) => cmd_config_set(ui, command, args),
|
||||
ConfigCommand::Edit(args) => cmd_config_edit(ui, command, args),
|
||||
ConfigCommand::Get(args) => cmd_config_get(ui, command, args),
|
||||
ConfigCommand::List(args) => cmd_config_list(ui, command, args),
|
||||
ConfigCommand::Path(args) => cmd_config_path(ui, command, args),
|
||||
ConfigCommand::Set(args) => cmd_config_set(ui, command, args),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,10 +35,10 @@ use crate::ui::Ui;
|
|||
/// copy
|
||||
#[derive(Subcommand, Clone, Debug)]
|
||||
pub(crate) enum SparseCommand {
|
||||
List(SparseListArgs),
|
||||
Set(SparseSetArgs),
|
||||
Reset(SparseResetArgs),
|
||||
Edit(SparseEditArgs),
|
||||
List(SparseListArgs),
|
||||
Reset(SparseResetArgs),
|
||||
Set(SparseSetArgs),
|
||||
}
|
||||
|
||||
/// List the patterns that are currently present in the working copy
|
||||
|
@ -91,10 +91,10 @@ pub(crate) fn cmd_sparse(
|
|||
subcommand: &SparseCommand,
|
||||
) -> Result<(), CommandError> {
|
||||
match subcommand {
|
||||
SparseCommand::List(args) => cmd_sparse_list(ui, command, args),
|
||||
SparseCommand::Set(args) => cmd_sparse_set(ui, command, args),
|
||||
SparseCommand::Reset(args) => cmd_sparse_reset(ui, command, args),
|
||||
SparseCommand::Edit(args) => cmd_sparse_edit(ui, command, args),
|
||||
SparseCommand::List(args) => cmd_sparse_list(ui, command, args),
|
||||
SparseCommand::Reset(args) => cmd_sparse_reset(ui, command, args),
|
||||
SparseCommand::Set(args) => cmd_sparse_set(ui, command, args),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -25,11 +25,11 @@ This document contains the help content for the `jj` command-line program.
|
|||
* [`jj branch untrack`↴](#jj-branch-untrack)
|
||||
* [`jj commit`↴](#jj-commit)
|
||||
* [`jj config`↴](#jj-config)
|
||||
* [`jj config list`↴](#jj-config-list)
|
||||
* [`jj config get`↴](#jj-config-get)
|
||||
* [`jj config set`↴](#jj-config-set)
|
||||
* [`jj config edit`↴](#jj-config-edit)
|
||||
* [`jj config get`↴](#jj-config-get)
|
||||
* [`jj config list`↴](#jj-config-list)
|
||||
* [`jj config path`↴](#jj-config-path)
|
||||
* [`jj config set`↴](#jj-config-set)
|
||||
* [`jj describe`↴](#jj-describe)
|
||||
* [`jj diff`↴](#jj-diff)
|
||||
* [`jj diffedit`↴](#jj-diffedit)
|
||||
|
@ -71,10 +71,10 @@ This document contains the help content for the `jj` command-line program.
|
|||
* [`jj root`↴](#jj-root)
|
||||
* [`jj show`↴](#jj-show)
|
||||
* [`jj sparse`↴](#jj-sparse)
|
||||
* [`jj sparse list`↴](#jj-sparse-list)
|
||||
* [`jj sparse set`↴](#jj-sparse-set)
|
||||
* [`jj sparse reset`↴](#jj-sparse-reset)
|
||||
* [`jj sparse edit`↴](#jj-sparse-edit)
|
||||
* [`jj sparse list`↴](#jj-sparse-list)
|
||||
* [`jj sparse reset`↴](#jj-sparse-reset)
|
||||
* [`jj sparse set`↴](#jj-sparse-set)
|
||||
* [`jj split`↴](#jj-split)
|
||||
* [`jj squash`↴](#jj-squash)
|
||||
* [`jj status`↴](#jj-status)
|
||||
|
@ -451,11 +451,46 @@ For file locations, supported config options, and other details about jj config,
|
|||
|
||||
###### **Subcommands:**
|
||||
|
||||
* `list` — List variables set in config file, along with their values
|
||||
* `get` — Get the value of a given config option.
|
||||
* `set` — Update config file to set the given option to a given value
|
||||
* `edit` — Start an editor on a jj config file
|
||||
* `get` — Get the value of a given config option.
|
||||
* `list` — List variables set in config file, along with their values
|
||||
* `path` — Print the path to the config file
|
||||
* `set` — Update config file to set the given option to a given value
|
||||
|
||||
|
||||
|
||||
## `jj config edit`
|
||||
|
||||
Start an editor on a jj config file.
|
||||
|
||||
Creates the file if it doesn't already exist regardless of what the editor does.
|
||||
|
||||
**Usage:** `jj config edit <--user|--repo>`
|
||||
|
||||
###### **Options:**
|
||||
|
||||
* `--user` — Target the user-level config
|
||||
* `--repo` — Target the repo-level config
|
||||
|
||||
|
||||
|
||||
## `jj config get`
|
||||
|
||||
Get the value of a given config option.
|
||||
|
||||
Unlike `jj config list`, the result of `jj config get` is printed without
|
||||
extra formatting and therefore is usable in scripting. For example:
|
||||
|
||||
$ jj config list user.name
|
||||
user.name="Martin von Zweigbergk"
|
||||
$ jj config get user.name
|
||||
Martin von Zweigbergk
|
||||
|
||||
**Usage:** `jj config get <NAME>`
|
||||
|
||||
###### **Arguments:**
|
||||
|
||||
* `<NAME>`
|
||||
|
||||
|
||||
|
||||
|
@ -487,23 +522,20 @@ List variables set in config file, along with their values
|
|||
|
||||
|
||||
|
||||
## `jj config get`
|
||||
## `jj config path`
|
||||
|
||||
Get the value of a given config option.
|
||||
Print the path to the config file
|
||||
|
||||
Unlike `jj config list`, the result of `jj config get` is printed without
|
||||
extra formatting and therefore is usable in scripting. For example:
|
||||
A config file at that path may or may not exist.
|
||||
|
||||
$ jj config list user.name
|
||||
user.name="Martin von Zweigbergk"
|
||||
$ jj config get user.name
|
||||
Martin von Zweigbergk
|
||||
See `jj config edit` if you'd like to immediately edit the file.
|
||||
|
||||
**Usage:** `jj config get <NAME>`
|
||||
**Usage:** `jj config path <--user|--repo>`
|
||||
|
||||
###### **Arguments:**
|
||||
###### **Options:**
|
||||
|
||||
* `<NAME>`
|
||||
* `--user` — Target the user-level config
|
||||
* `--repo` — Target the repo-level config
|
||||
|
||||
|
||||
|
||||
|
@ -525,38 +557,6 @@ Update config file to set the given option to a given value
|
|||
|
||||
|
||||
|
||||
## `jj config edit`
|
||||
|
||||
Start an editor on a jj config file.
|
||||
|
||||
Creates the file if it doesn't already exist regardless of what the editor does.
|
||||
|
||||
**Usage:** `jj config edit <--user|--repo>`
|
||||
|
||||
###### **Options:**
|
||||
|
||||
* `--user` — Target the user-level config
|
||||
* `--repo` — Target the repo-level config
|
||||
|
||||
|
||||
|
||||
## `jj config path`
|
||||
|
||||
Print the path to the config file
|
||||
|
||||
A config file at that path may or may not exist.
|
||||
|
||||
See `jj config edit` if you'd like to immediately edit the file.
|
||||
|
||||
**Usage:** `jj config path <--user|--repo>`
|
||||
|
||||
###### **Options:**
|
||||
|
||||
* `--user` — Target the user-level config
|
||||
* `--repo` — Target the repo-level config
|
||||
|
||||
|
||||
|
||||
## `jj describe`
|
||||
|
||||
Update the change description or other metadata
|
||||
|
@ -1624,10 +1624,18 @@ Manage which paths from the working-copy commit are present in the working copy
|
|||
|
||||
###### **Subcommands:**
|
||||
|
||||
* `list` — List the patterns that are currently present in the working copy
|
||||
* `set` — Update the patterns that are present in the working copy
|
||||
* `reset` — Reset the patterns to include all files in the working copy
|
||||
* `edit` — Start an editor to update the patterns that are present in the working copy
|
||||
* `list` — List the patterns that are currently present in the working copy
|
||||
* `reset` — Reset the patterns to include all files in the working copy
|
||||
* `set` — Update the patterns that are present in the working copy
|
||||
|
||||
|
||||
|
||||
## `jj sparse edit`
|
||||
|
||||
Start an editor to update the patterns that are present in the working copy
|
||||
|
||||
**Usage:** `jj sparse edit`
|
||||
|
||||
|
||||
|
||||
|
@ -1641,6 +1649,14 @@ By default, a newly cloned or initialized repo will have have a pattern matching
|
|||
|
||||
|
||||
|
||||
## `jj sparse reset`
|
||||
|
||||
Reset the patterns to include all files in the working copy
|
||||
|
||||
**Usage:** `jj sparse reset`
|
||||
|
||||
|
||||
|
||||
## `jj sparse set`
|
||||
|
||||
Update the patterns that are present in the working copy
|
||||
|
@ -1657,22 +1673,6 @@ For example, if all you need is the `README.md` and the `lib/` directory, use `j
|
|||
|
||||
|
||||
|
||||
## `jj sparse reset`
|
||||
|
||||
Reset the patterns to include all files in the working copy
|
||||
|
||||
**Usage:** `jj sparse reset`
|
||||
|
||||
|
||||
|
||||
## `jj sparse edit`
|
||||
|
||||
Start an editor to update the patterns that are present in the working copy
|
||||
|
||||
**Usage:** `jj sparse edit`
|
||||
|
||||
|
||||
|
||||
## `jj split`
|
||||
|
||||
Split a revision in two
|
||||
|
|
Loading…
Reference in a new issue