Skip to content

Commit 119faf5

Browse files
committed
Rename commands
1 parent 76caf3b commit 119faf5

4 files changed

Lines changed: 11 additions & 10 deletions

File tree

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ Change directory to a git repo with a CODEOWNERS file.
2020
Usage: git-codeowners [OPTIONS] <COMMAND>
2121
2222
Commands:
23-
find Find owners for the specified paths. Reads paths from STDIN if not provided as positional arguments
24-
help Print this message or the help of the given subcommand(s)
23+
of Find owners for the specified paths. Reads paths from STDIN if not provided as positional arguments
24+
inventory Print all files owned by the specified owner
25+
help Print this message or the help of the given subcommand(s)
2526
2627
Options:
2728
-p, --path <PATH> Path to the CODEOWNERS file [default: .github/CODEOWNERS]
@@ -31,5 +32,5 @@ Options:
3132

3233
### Detecting CODEOWNERS of all files changed in a branch
3334
```sh
34-
git diff (git merge-base origin/main HEAD) --name-only | git codeowners find
35+
git diff (git merge-base origin/main HEAD) --name-only | git codeowners of
3536
```
File renamed without changes.

src/main.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
mod owned;
2-
mod owners;
1+
mod inventory;
2+
mod of;
33
mod parser;
44

55
use clap::{Parser, Subcommand};
@@ -22,9 +22,9 @@ struct Cli {
2222
enum Command {
2323
/// Find owners for the specified paths.
2424
/// Reads paths from STDIN if not provided as positional arguments.
25-
Find { paths: Vec<String> },
25+
Of { paths: Vec<String> },
2626
/// Print all files owned by the specified owner.
27-
OwnedBy {
27+
Inventory {
2828
owner: String,
2929

3030
#[arg(short, long, default_value = ".")]
@@ -38,16 +38,16 @@ fn main() -> Result<()> {
3838
let codeowners = parser::parse(&fs::read_to_string(cli.path)?);
3939

4040
match cli.command {
41-
Command::Find { paths } => {
41+
Command::Of { paths } => {
4242
let paths = if paths.is_empty() {
4343
paths_from_stdin()
4444
} else {
4545
paths
4646
};
4747

48-
owners::find_and_print(codeowners, paths.into_iter())
48+
of::find_and_print(codeowners, paths.into_iter())
4949
}
50-
Command::OwnedBy { owner, dir } => owned::by(codeowners, &owner, &dir),
50+
Command::Inventory { owner, dir } => inventory::by(codeowners, &owner, &dir),
5151
}
5252
}
5353

File renamed without changes.

0 commit comments

Comments
 (0)