@@ -4,22 +4,22 @@ use crate::pair::LocalPair;
44use crate :: util:: { read_file_to_string, write_file} ;
55use anyhow:: anyhow;
66use anyhow:: { bail, Context } ;
7- use clap:: { ArgGroup , Args } ;
7+ use clap:: { ArgGroup , Args as ClapArgs } ;
88use qos_core:: protocol:: services:: boot:: Approval ;
99use qos_core:: protocol:: services:: boot:: {
1010 Manifest , ManifestSet , Namespace , NitroConfig , PivotConfig , QuorumMember , ShareSet ,
1111} ;
1212use qos_core:: protocol:: QosHash ;
13+ use std:: io:: { BufRead , Write } ;
1314use std:: path:: Path ;
1415use std:: path:: PathBuf ;
15- use std:: io:: { BufRead , Write } ;
1616
17- /// Approve a QOS manifest
18- #[ derive( Debug , Args ) ]
17+ /// Approve a QOS manifest.
18+ #[ derive( Debug , ClapArgs ) ]
1919#[ command( about, long_about = None ) ]
2020#[ command( group( ArgGroup :: new( "operator" ) . args( [ "operator_seed" , "operator_id" ] ) ) ) ]
2121#[ command( group( ArgGroup :: new( "manifest-source" ) . args( [ "manifest" , "deploy_id" ] ) ) ) ]
22- pub struct ApproveManifest {
22+ pub struct Args {
2323 /// Path to QOS manifest file.
2424 #[ arg(
2525 short,
@@ -29,7 +29,7 @@ pub struct ApproveManifest {
2929 ) ]
3030 pub manifest : Option < PathBuf > ,
3131
32- /// ID of the deployment the manifest belongs to
32+ /// ID of the deployment the manifest belongs to.
3333 #[ arg(
3434 short,
3535 long,
@@ -38,41 +38,41 @@ pub struct ApproveManifest {
3838 ) ]
3939 pub deploy_id : Option < String > ,
4040
41- /// Path to the file containing the master seed for the operator key
41+ /// Path to the file containing the master seed for the operator key.
4242 #[ arg(
4343 long,
4444 help_heading = "Operator to approve with (pick one)" ,
4545 value_name = "PATH"
4646 ) ]
4747 pub operator_seed : Option < PathBuf > ,
4848
49- /// Operator ID to use
49+ /// Operator ID to use.
5050 #[ arg(
5151 long,
5252 help_heading = "Operator to approve with (pick one)" ,
5353 env = "TVC_OPERATOR_ID"
5454 ) ]
5555 pub operator_id : Option < String > ,
5656
57- /// Walk through manifest approval prompts but do not generate an approval
57+ /// Walk through manifest approval prompts but do not generate an approval.
5858 #[ arg( long) ]
5959 pub dry_run : bool ,
6060
61- /// DANGEROUS: skip interactive prompts for approving each aspect of manifest
61+ /// DANGEROUS: skip interactive prompts for approving each aspect of manifest.
6262 #[ arg( long) ]
6363 pub dangerous_skip_interactive : bool ,
6464
65- /// Write approval to file instead of stdout
65+ /// Write approval to file instead of stdout.
6666 #[ arg( short, long, value_name = "PATH" ) ]
6767 pub output : Option < PathBuf > ,
6868
69- /// Don't post approval to the API
69+ /// Don't post approval to the API.
7070 #[ arg( long) ]
7171 pub skip_post : bool ,
7272}
7373
7474/// Run the approve manifest command.
75- pub async fn run ( args : ApproveManifest , _config : & crate :: cli:: GlobalConfig ) -> anyhow:: Result < ( ) > {
75+ pub async fn run ( args : Args , _config : & crate :: cli:: GlobalConfig ) -> anyhow:: Result < ( ) > {
7676 let manifest = match ( & args. manifest , & args. deploy_id ) {
7777 ( Some ( path) , _) => read_manifest_from_path ( path) . await ?,
7878 ( _, Some ( deploy_id) ) => fetch_manifest_from_deploy ( deploy_id) . await ?,
0 commit comments