@@ -187,7 +187,7 @@ pub enum Command {
187187 long,
188188 short,
189189 default_value = "20" ,
190- parse ( try_from_str = parse_duration_in_secs)
190+ value_parser = parse_duration_in_secs
191191 ) ]
192192 sleep : Duration ,
193193 } ,
@@ -205,7 +205,7 @@ pub enum Command {
205205 long,
206206 short,
207207 default_value = "20" ,
208- parse ( try_from_str = parse_duration_in_secs)
208+ value_parser = parse_duration_in_secs
209209 ) ]
210210 sleep : Duration ,
211211 /// The block hash of the target block
@@ -225,7 +225,7 @@ pub enum Command {
225225 ) ]
226226 block_number : Option < i32 > ,
227227 /// The deployments to rewind (see `help info`)
228- #[ clap( required = true , min_values = 1 ) ]
228+ #[ clap( required = true ) ]
229229 deployments : Vec < DeploymentSearch > ,
230230 } ,
231231 /// Deploy and run an arbitrary subgraph up to a certain block
@@ -534,13 +534,13 @@ pub enum ChainCommand {
534534 #[ clap( subcommand) ] // Note that we mark a field as a subcommand
535535 method : CheckBlockMethod ,
536536 /// Chain name (must be an existing chain, see 'chain list')
537- #[ clap( empty_values = false ) ]
537+ #[ clap( value_parser = clap :: builder :: NonEmptyStringValueParser :: new ( ) ) ]
538538 chain_name : String ,
539539 } ,
540540 /// Truncates the whole block cache for the given chain.
541541 Truncate {
542542 /// Chain name (must be an existing chain, see 'chain list')
543- #[ clap( empty_values = false ) ]
543+ #[ clap( value_parser = clap :: builder :: NonEmptyStringValueParser :: new ( ) ) ]
544544 chain_name : String ,
545545 /// Skips confirmation prompt
546546 #[ clap( long, short) ]
@@ -550,10 +550,10 @@ pub enum ChainCommand {
550550 /// Change the block cache shard for a chain
551551 ChangeShard {
552552 /// Chain name (must be an existing chain, see 'chain list')
553- #[ clap( empty_values = false ) ]
553+ #[ clap( value_parser = clap :: builder :: NonEmptyStringValueParser :: new ( ) ) ]
554554 chain_name : String ,
555555 /// Shard name
556- #[ clap( empty_values = false ) ]
556+ #[ clap( value_parser = clap :: builder :: NonEmptyStringValueParser :: new ( ) ) ]
557557 shard : String ,
558558 } ,
559559
@@ -562,7 +562,7 @@ pub enum ChainCommand {
562562 #[ clap( subcommand) ]
563563 method : CallCacheCommand ,
564564 /// Chain name (must be an existing chain, see 'chain list')
565- #[ clap( empty_values = false ) ]
565+ #[ clap( value_parser = clap :: builder :: NonEmptyStringValueParser :: new ( ) ) ]
566566 chain_name : String ,
567567 } ,
568568}
@@ -674,24 +674,24 @@ pub enum IndexCommand {
674674 /// This command may be time-consuming.
675675 Create {
676676 /// The deployment (see `help info`).
677- #[ clap( empty_values = false ) ]
677+ #[ clap( value_parser = clap :: builder :: NonEmptyStringValueParser :: new ( ) ) ]
678678 deployment : DeploymentSearch ,
679679 /// The Entity name.
680680 ///
681681 /// Can be expressed either in upper camel case (as its GraphQL definition) or in snake case
682682 /// (as its SQL table name).
683- #[ clap( empty_values = false ) ]
683+ #[ clap( value_parser = clap :: builder :: NonEmptyStringValueParser :: new ( ) ) ]
684684 entity : String ,
685685 /// The Field names.
686686 ///
687687 /// Each field can be expressed either in camel case (as its GraphQL definition) or in snake
688688 /// case (as its SQL colmun name).
689- #[ clap( min_values = 1 , required = true ) ]
689+ #[ clap( required = true ) ]
690690 fields : Vec < String > ,
691691 /// The index method. Defaults to `btree` in general, and to `gist` when the index includes the `block_range` column
692692 #[ clap(
693- short, long,
694- possible_values = & [ "btree" , "hash" , "gist" , "spgist" , "gin" , "brin" ]
693+ short, long, default_value = "btree" ,
694+ value_parser = clap :: builder :: PossibleValuesParser :: new ( & [ "btree" , "hash" , "gist" , "spgist" , "gin" , "brin" ] )
695695 ) ]
696696 method : Option < String > ,
697697
@@ -718,23 +718,23 @@ pub enum IndexCommand {
718718 #[ clap( long, requires = "sql" ) ]
719719 if_not_exists : bool ,
720720 /// The deployment (see `help info`).
721- #[ clap( empty_values = false ) ]
721+ #[ clap( value_parser = clap :: builder :: NonEmptyStringValueParser :: new ( ) ) ]
722722 deployment : DeploymentSearch ,
723723 /// The Entity name.
724724 ///
725725 /// Can be expressed either in upper camel case (as its GraphQL definition) or in snake case
726726 /// (as its SQL table name).
727- #[ clap( empty_values = false ) ]
727+ #[ clap( value_parser = clap :: builder :: NonEmptyStringValueParser :: new ( ) ) ]
728728 entity : String ,
729729 } ,
730730
731731 /// Drops an index for a given deployment, concurrently
732732 Drop {
733733 /// The deployment (see `help info`).
734- #[ clap( empty_values = false ) ]
734+ #[ clap( value_parser = clap :: builder :: NonEmptyStringValueParser :: new ( ) ) ]
735735 deployment : DeploymentSearch ,
736736 /// The name of the index to be dropped
737- #[ clap( empty_values = false ) ]
737+ #[ clap( value_parser = clap :: builder :: NonEmptyStringValueParser :: new ( ) ) ]
738738 index_name : String ,
739739 } ,
740740}
0 commit comments