File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -3,14 +3,14 @@ use std::collections::HashMap;
3
3
use std:: fs;
4
4
use std:: path:: { Path , PathBuf } ;
5
5
6
- pub fn run ( paths : & [ String ] ) {
6
+ pub fn run ( paths : & [ & str ] ) {
7
7
let blob_paths = find_blobs_in_paths ( & paths) ;
8
8
let blobs_to_dependencies = get_dependencies ( & blob_paths) ;
9
9
let missing_blobs = identify_missing ( & blobs_to_dependencies) ;
10
10
display_missing_blobs ( & missing_blobs) ;
11
11
}
12
12
13
- fn find_blobs_in_paths ( paths : & [ String ] ) -> Vec < PathBuf > {
13
+ fn find_blobs_in_paths ( paths : & [ & str ] ) -> Vec < PathBuf > {
14
14
let dirs = paths
15
15
. iter ( )
16
16
. map ( Path :: new)
Original file line number Diff line number Diff line change 1
- use std:: env;
2
-
3
1
use aosp_missing_blobs:: run;
4
- use clap:: App ;
2
+ use clap:: { App , Arg } ;
5
3
6
4
fn main ( ) {
7
- App :: new ( "aosp-missing-blobs" )
5
+ let matches = App :: new ( "aosp-missing-blobs" )
8
6
. version ( "0.3.0" )
9
7
. author ( "Josh Choo <dev@joshuous.com>" )
10
8
. about ( "An AOSP tool to generate a list of required missing blobs." )
9
+ . arg (
10
+ Arg :: with_name ( "PATHS" )
11
+ . help ( "Paths to blobs" )
12
+ . required ( true )
13
+ . multiple ( true ) ,
14
+ )
11
15
. get_matches ( ) ;
12
16
13
- let args: Vec < String > = env:: args ( ) . collect ( ) ;
14
- let paths = & args[ 1 ..] ;
17
+ let paths = matches. values_of ( "PATHS" ) . unwrap ( ) . collect :: < Vec < _ > > ( ) ;
15
18
16
- run ( paths) ;
19
+ run ( & paths) ;
17
20
}
You can’t perform that action at this time.
0 commit comments