@@ -5,28 +5,22 @@ use rover_client::operations::graph::check::{self, GraphCheckInput};
5
5
use rover_client:: shared:: { CheckConfig , GitContext , ValidationPeriod } ;
6
6
7
7
use crate :: command:: RoverOutput ;
8
- use crate :: options:: GraphRefOpt ;
8
+ use crate :: options:: { GraphRefOpt , ProfileOpt , SchemaOpt } ;
9
9
use crate :: utils:: client:: StudioClientConfig ;
10
- use crate :: utils:: parsers:: {
11
- parse_file_descriptor, parse_query_count_threshold, parse_query_percentage_threshold,
12
- FileDescriptorType ,
13
- } ;
10
+ use crate :: utils:: parsers:: { parse_query_count_threshold, parse_query_percentage_threshold} ;
14
11
use crate :: Result ;
15
12
16
13
#[ derive( Debug , Serialize , StructOpt ) ]
17
14
pub struct Check {
18
15
#[ structopt( flatten) ]
19
16
graph : GraphRefOpt ,
20
17
21
- /// Name of configuration profile to use
22
- #[ structopt( long = "profile" , default_value = "default" ) ]
23
- #[ serde( skip_serializing) ]
24
- profile_name : String ,
18
+ #[ structopt( flatten) ]
19
+ profile : ProfileOpt ,
25
20
26
- /// The schema file to check. You can pass `-` to use stdin instead of a file.
27
- #[ structopt( long, short = "s" , parse( try_from_str = parse_file_descriptor) ) ]
21
+ #[ structopt( flatten) ]
28
22
#[ serde( skip_serializing) ]
29
- schema : FileDescriptorType ,
23
+ schema : SchemaOpt ,
30
24
31
25
/// The minimum number of times a query or mutation must have been executed
32
26
/// in order to be considered in the check operation
@@ -50,7 +44,7 @@ impl Check {
50
44
client_config : StudioClientConfig ,
51
45
git_context : GitContext ,
52
46
) -> Result < RoverOutput > {
53
- let client = client_config. get_authenticated_client ( & self . profile_name ) ?;
47
+ let client = client_config. get_authenticated_client ( & self . profile . profile_name ) ?;
54
48
let proposed_schema = self
55
49
. schema
56
50
. read_file_descriptor ( "SDL" , & mut std:: io:: stdin ( ) ) ?;
0 commit comments