Skip to content

Commit c1bf991

Browse files
committed
Prefix meta calls with commands mod
1 parent 25f64ad commit c1bf991

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/app.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::colors::BOLD;
22
use crate::colors::RESET;
3-
use crate::commands::METAS;
3+
use crate::commands;
44
use crate::env;
55
use clap::command;
66
use clap::crate_description;
@@ -18,7 +18,7 @@ pub fn build() -> Command {
1818
.after_help(get_after_help(None))
1919
.subcommand_required(true);
2020

21-
for meta in METAS {
21+
for meta in commands::METAS {
2222
let command = meta.build().after_help(get_after_help(Some(meta.name)));
2323
app = app.subcommand(command);
2424
}

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use rew::app;
2-
use rew::commands::get_meta;
2+
use rew::commands;
33
use rew::error::Reporter;
44
use std::io;
55
use std::process::ExitCode;
@@ -22,7 +22,7 @@ fn main() -> ExitCode {
2222
};
2323

2424
let (cmd_name, cmd_matches) = matches.subcommand().expect("command not matched");
25-
let cmd = get_meta(cmd_name).expect("command not found");
25+
let cmd = commands::get_meta(cmd_name).expect("command not found");
2626

2727
match cmd.run(cmd_matches) {
2828
Ok(()) => ExitCode::from(0),

src/process.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::command::Group;
22
use crate::command::Meta;
3-
use crate::commands::get_meta;
3+
use crate::commands;
44
use crate::env::Env;
55
use crate::spawn::ContextItem;
66
use crate::spawn::SpawnWithContext;
@@ -43,14 +43,14 @@ impl Command {
4343

4444
if name == crate_name!() {
4545
if let Some((name, args)) = args.split_first() {
46-
if let Some(meta) = get_meta(name) {
46+
if let Some(meta) = commands::get_meta(name) {
4747
return Self::internal(meta, args);
4848
}
4949
}
5050
return Self::unknown_internal(args);
5151
}
5252

53-
if let Some(meta) = get_meta(name) {
53+
if let Some(meta) = commands::get_meta(name) {
5454
return Self::internal(meta, args);
5555
}
5656

xtask/src/command.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use clap::Arg;
88
use clap::Command;
99
use rew::command::Group;
1010
use rew::command::Meta;
11-
use rew::commands::get_meta;
11+
use rew::commands;
1212
use rew::examples::Example;
1313
use std::borrow::Cow;
1414
use std::iter::Peekable;
@@ -32,7 +32,7 @@ impl<'a> Adapter<'a> {
3232

3333
fn meta(&self) -> Option<&'static Meta> {
3434
if self.parents.len() == 1 {
35-
get_meta(self.name()) // Only the main commands have metadata
35+
commands::get_meta(self.name()) // Only the main commands have metadata
3636
} else {
3737
None
3838
}

0 commit comments

Comments
 (0)