Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: file: sort subcommands chronologically #3910

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cli/src/commands/file/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ use crate::ui::Ui;
/// File operations.
#[derive(clap::Subcommand, Clone, Debug)]
pub enum FileCommand {
Print(print::PrintArgs),
Chmod(chmod::ChmodArgs),
List(list::ListArgs),
Print(print::PrintArgs),
}

pub fn cmd_file(
Expand All @@ -34,8 +34,8 @@ pub fn cmd_file(
subcommand: &FileCommand,
) -> Result<(), CommandError> {
match subcommand {
FileCommand::Print(sub_args) => print::cmd_print(ui, command, sub_args),
FileCommand::Chmod(sub_args) => chmod::cmd_chmod(ui, command, sub_args),
FileCommand::List(sub_args) => list::cmd_list(ui, command, sub_args),
FileCommand::Print(sub_args) => print::cmd_print(ui, command, sub_args),
}
}
44 changes: 22 additions & 22 deletions cli/tests/cli-reference@.md.snap
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ This document contains the help content for the `jj` command-line program.
* [`jj duplicate`↴](#jj-duplicate)
* [`jj edit`↴](#jj-edit)
* [`jj file`↴](#jj-file)
* [`jj file print`↴](#jj-file-print)
* [`jj file chmod`↴](#jj-file-chmod)
* [`jj file list`↴](#jj-file-list)
* [`jj file print`↴](#jj-file-print)
* [`jj fix`↴](#jj-fix)
* [`jj git`↴](#jj-git)
* [`jj git remote`↴](#jj-git-remote)
Expand Down Expand Up @@ -652,29 +652,9 @@ File operations

###### **Subcommands:**

* `print` — Print contents of files in a revision
* `chmod` — Sets or removes the executable bit for paths in the repo
* `list` — List files in a revision



## `jj file print`

Print contents of files in a revision

If the given path is a directory, files in the directory will be visited recursively.

**Usage:** `jj file print [OPTIONS] <PATHS>...`

###### **Arguments:**

* `<PATHS>` — Paths to print

###### **Options:**

* `-r`, `--revision <REVISION>` — The revision to get the file contents from

Default value: `@`
* `print` — Print contents of files in a revision



Expand Down Expand Up @@ -724,6 +704,26 @@ List files in a revision



## `jj file print`

Print contents of files in a revision

If the given path is a directory, files in the directory will be visited recursively.

**Usage:** `jj file print [OPTIONS] <PATHS>...`

###### **Arguments:**

* `<PATHS>` — Paths to print

###### **Options:**

* `-r`, `--revision <REVISION>` — The revision to get the file contents from

Default value: `@`



## `jj fix`

Update files with formatting fixes or other changes
Expand Down