File tree Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 1
1
use crate :: colors:: BOLD ;
2
2
use crate :: colors:: RESET ;
3
- use crate :: commands:: METAS ;
3
+ use crate :: commands;
4
4
use crate :: env;
5
5
use clap:: command;
6
6
use clap:: crate_description;
@@ -18,7 +18,7 @@ pub fn build() -> Command {
18
18
. after_help ( get_after_help ( None ) )
19
19
. subcommand_required ( true ) ;
20
20
21
- for meta in METAS {
21
+ for meta in commands :: METAS {
22
22
let command = meta. build ( ) . after_help ( get_after_help ( Some ( meta. name ) ) ) ;
23
23
app = app. subcommand ( command) ;
24
24
}
Original file line number Diff line number Diff line change 1
1
use rew:: app;
2
- use rew:: commands:: get_meta ;
2
+ use rew:: commands;
3
3
use rew:: error:: Reporter ;
4
4
use std:: io;
5
5
use std:: process:: ExitCode ;
@@ -22,7 +22,7 @@ fn main() -> ExitCode {
22
22
} ;
23
23
24
24
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" ) ;
26
26
27
27
match cmd. run ( cmd_matches) {
28
28
Ok ( ( ) ) => ExitCode :: from ( 0 ) ,
Original file line number Diff line number Diff line change 1
1
use crate :: command:: Group ;
2
2
use crate :: command:: Meta ;
3
- use crate :: commands:: get_meta ;
3
+ use crate :: commands;
4
4
use crate :: env:: Env ;
5
5
use crate :: spawn:: ContextItem ;
6
6
use crate :: spawn:: SpawnWithContext ;
@@ -43,14 +43,14 @@ impl Command {
43
43
44
44
if name == crate_name ! ( ) {
45
45
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) {
47
47
return Self :: internal ( meta, args) ;
48
48
}
49
49
}
50
50
return Self :: unknown_internal ( args) ;
51
51
}
52
52
53
- if let Some ( meta) = get_meta ( name) {
53
+ if let Some ( meta) = commands :: get_meta ( name) {
54
54
return Self :: internal ( meta, args) ;
55
55
}
56
56
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ use clap::Arg;
8
8
use clap:: Command ;
9
9
use rew:: command:: Group ;
10
10
use rew:: command:: Meta ;
11
- use rew:: commands:: get_meta ;
11
+ use rew:: commands;
12
12
use rew:: examples:: Example ;
13
13
use std:: borrow:: Cow ;
14
14
use std:: iter:: Peekable ;
@@ -32,7 +32,7 @@ impl<'a> Adapter<'a> {
32
32
33
33
fn meta ( & self ) -> Option < & ' static Meta > {
34
34
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
36
36
} else {
37
37
None
38
38
}
You can’t perform that action at this time.
0 commit comments