File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ struct Options {
16
16
flag_target : Option < String > ,
17
17
flag_manifest_path : Option < String > ,
18
18
flag_verbose : bool ,
19
+ flag_quiet : bool ,
19
20
flag_release : bool ,
20
21
arg_args : Vec < String > ,
21
22
}
@@ -37,6 +38,7 @@ Options:
37
38
--target TRIPLE Build for the target triple
38
39
--manifest-path PATH Path to the manifest to execute
39
40
-v, --verbose Use verbose output
41
+ -q, --quiet No output printed to stdout
40
42
41
43
If neither `--name` or `--example` are given, then if the project only has one
42
44
bin target it will be run. Otherwise `--name` specifies the bin target to run,
@@ -46,8 +48,23 @@ and `--example` specifies the example target to run. At most one of `--name` or
46
48
All of the trailing arguments are passed as to the binary to run.
47
49
" ;
48
50
51
+
49
52
pub fn execute ( options : Options , shell : & mut MultiShell ) -> CliResult < Option < ( ) > > {
50
- shell. set_verbose ( options. flag_verbose ) ;
53
+ shell. set_verbosity ( match ( options. flag_verbose , options. flag_quiet ) {
54
+ ( true , true ) => {
55
+ fail ! ( "You cannot set both --verbose and --quiet" ) ;
56
+ } ,
57
+ ( true , _) => {
58
+ shell:: Verbose
59
+ } ,
60
+ ( _, true ) => {
61
+ shell:: Quiet
62
+ }
63
+ _ => {
64
+ shell:: Normal
65
+ }
66
+ } ) ;
67
+
51
68
let root = try!( find_root_manifest_for_cwd ( options. flag_manifest_path ) ) ;
52
69
53
70
let env = if options. flag_example . is_some ( ) {
You can’t perform that action at this time.
0 commit comments