1515// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
1616
1717use crate :: chain_spec;
18+ use clap:: { AppSettings , Parser } ;
1819use std:: path:: PathBuf ;
19- use structopt:: StructOpt ;
2020
2121/// Sub-commands supported by the collator.
22- #[ derive( Debug , StructOpt ) ]
22+ #[ derive( Debug , Parser ) ]
2323pub enum Subcommand {
2424 /// Export the genesis state of the parachain.
25- #[ structopt ( name = "export-genesis-state" ) ]
25+ #[ clap ( name = "export-genesis-state" ) ]
2626 ExportGenesisState ( ExportGenesisStateCommand ) ,
2727
2828 /// Export the genesis wasm of the parachain.
29- #[ structopt ( name = "export-genesis-wasm" ) ]
29+ #[ clap ( name = "export-genesis-wasm" ) ]
3030 ExportGenesisWasm ( ExportGenesisWasmCommand ) ,
3131
3232 /// Build a chain specification.
@@ -51,66 +51,66 @@ pub enum Subcommand {
5151 Revert ( sc_cli:: RevertCmd ) ,
5252
5353 /// The custom benchmark subcommmand benchmarking runtime pallets.
54- #[ structopt ( name = "benchmark" , about = "Benchmark runtime pallets." ) ]
54+ #[ clap ( name = "benchmark" , about = "Benchmark runtime pallets." ) ]
5555 Benchmark ( frame_benchmarking_cli:: BenchmarkCmd ) ,
5656}
5757
5858/// Command for exporting the genesis state of the parachain
59- #[ derive( Debug , StructOpt ) ]
59+ #[ derive( Debug , Parser ) ]
6060pub struct ExportGenesisStateCommand {
6161 /// Output file name or stdout if unspecified.
62- #[ structopt ( parse( from_os_str) ) ]
62+ #[ clap ( parse( from_os_str) ) ]
6363 pub output : Option < PathBuf > ,
6464
6565 /// Id of the parachain this state is for.
6666 ///
6767 /// Default: 100
68- #[ structopt ( long, conflicts_with = "chain" ) ]
68+ #[ clap ( long, conflicts_with = "chain" ) ]
6969 pub parachain_id : Option < u32 > ,
7070
7171 /// Write output in binary. Default is to write in hex.
72- #[ structopt ( short, long) ]
72+ #[ clap ( short, long) ]
7373 pub raw : bool ,
7474
7575 /// The name of the chain for that the genesis state should be exported.
76- #[ structopt ( long, conflicts_with = "parachain-id" ) ]
76+ #[ clap ( long, conflicts_with = "parachain-id" ) ]
7777 pub chain : Option < String > ,
7878}
7979
8080/// Command for exporting the genesis wasm file.
81- #[ derive( Debug , StructOpt ) ]
81+ #[ derive( Debug , Parser ) ]
8282pub struct ExportGenesisWasmCommand {
8383 /// Output file name or stdout if unspecified.
84- #[ structopt ( parse( from_os_str) ) ]
84+ #[ clap ( parse( from_os_str) ) ]
8585 pub output : Option < PathBuf > ,
8686
8787 /// Write output in binary. Default is to write in hex.
88- #[ structopt ( short, long) ]
88+ #[ clap ( short, long) ]
8989 pub raw : bool ,
9090
9191 /// The name of the chain for that the genesis wasm file should be exported.
92- #[ structopt ( long) ]
92+ #[ clap ( long) ]
9393 pub chain : Option < String > ,
9494}
9595
96- #[ derive( Debug , StructOpt ) ]
97- #[ structopt ( settings = & [
98- structopt :: clap :: AppSettings :: GlobalVersion ,
99- structopt :: clap :: AppSettings :: ArgsNegateSubcommands ,
100- structopt :: clap :: AppSettings :: SubcommandsNegateReqs ,
101- ] ) ]
96+ #[ derive( Debug , Parser ) ]
97+ #[ clap ( setting (
98+ AppSettings :: PropagateVersion |
99+ AppSettings :: ArgsNegateSubcommands |
100+ AppSettings :: SubcommandsNegateReqs ,
101+ ) ) ]
102102pub struct Cli {
103- #[ structopt ( subcommand) ]
103+ #[ clap ( subcommand) ]
104104 pub subcommand : Option < Subcommand > ,
105105
106- #[ structopt ( long) ]
106+ #[ clap ( long) ]
107107 pub parachain_id : Option < u32 > ,
108108
109- #[ structopt ( flatten) ]
109+ #[ clap ( flatten) ]
110110 pub run : cumulus_client_cli:: RunCmd ,
111111
112112 /// Relaychain arguments
113- #[ structopt ( raw = true ) ]
113+ #[ clap ( raw = true ) ]
114114 pub relaychain_args : Vec < String > ,
115115}
116116
@@ -135,6 +135,6 @@ impl RelayChainCli {
135135 let extension = chain_spec:: Extensions :: try_get ( & * para_config. chain_spec ) ;
136136 let chain_id = extension. map ( |e| e. relay_chain . clone ( ) ) ;
137137 let base_path = para_config. base_path . as_ref ( ) . map ( |x| x. path ( ) . join ( "rialto-bridge-node" ) ) ;
138- Self { base_path, chain_id, base : polkadot_cli:: RunCmd :: from_iter ( relay_chain_args) }
138+ Self { base_path, chain_id, base : polkadot_cli:: RunCmd :: parse_from ( relay_chain_args) }
139139 }
140140}
0 commit comments