@@ -680,15 +680,10 @@ baz
680
680
#[ test]
681
681
fn suggest_multi_positional ( ) {
682
682
let mut cmd = Command :: new ( "dynamic" )
683
- . arg (
684
- clap:: Arg :: new ( "positional-1" )
685
- . value_parser ( [ "pos_1" ] )
686
- . index ( 1 ) ,
687
- )
683
+ . arg ( clap:: Arg :: new ( "positional-1" ) . value_parser ( [ "pos_1" ] ) )
688
684
. arg (
689
685
clap:: Arg :: new ( "positional-2" )
690
686
. value_parser ( [ "pos_2_a" , "pos_2_b" , "pos_2_c" ] )
691
- . index ( 2 )
692
687
. num_args ( 3 ) ,
693
688
)
694
689
. arg (
@@ -774,7 +769,6 @@ fn suggest_multi_positional_unbounded() {
774
769
. arg (
775
770
clap:: Arg :: new ( "positional" )
776
771
. value_parser ( [ "pos_1" , "pos_2" ] )
777
- . index ( 1 )
778
772
. num_args ( 2 ..) ,
779
773
)
780
774
. arg (
@@ -847,7 +841,6 @@ fn suggest_delimiter_values() {
847
841
)
848
842
. arg (
849
843
clap:: Arg :: new ( "pos" )
850
- . index ( 1 )
851
844
. value_parser ( [ "a_pos" , "b_pos" , "c_pos" ] )
852
845
. value_delimiter ( ',' ) ,
853
846
) ;
@@ -1046,14 +1039,9 @@ fn suggest_positional_long_allow_hyphen() {
1046
1039
. arg (
1047
1040
clap:: Arg :: new ( "positional_a" )
1048
1041
. value_parser ( [ "--pos_a" ] )
1049
- . index ( 1 )
1050
1042
. allow_hyphen_values ( true ) ,
1051
1043
)
1052
- . arg (
1053
- clap:: Arg :: new ( "positional_b" )
1054
- . index ( 2 )
1055
- . value_parser ( [ "pos_b" ] ) ,
1056
- ) ;
1044
+ . arg ( clap:: Arg :: new ( "positional_b" ) . value_parser ( [ "pos_b" ] ) ) ;
1057
1045
1058
1046
assert_data_eq ! (
1059
1047
complete!( cmd, "--format --json --pos[TAB]" ) ,
@@ -1104,14 +1092,9 @@ fn suggest_positional_short_allow_hyphen() {
1104
1092
. arg (
1105
1093
clap:: Arg :: new ( "positional_a" )
1106
1094
. value_parser ( [ "-a" ] )
1107
- . index ( 1 )
1108
1095
. allow_hyphen_values ( true ) ,
1109
1096
)
1110
- . arg (
1111
- clap:: Arg :: new ( "positional_b" )
1112
- . index ( 2 )
1113
- . value_parser ( [ "pos_b" ] ) ,
1114
- ) ;
1097
+ . arg ( clap:: Arg :: new ( "positional_b" ) . value_parser ( [ "pos_b" ] ) ) ;
1115
1098
1116
1099
assert_data_eq ! (
1117
1100
complete!( cmd, "--format --json -a [TAB]" ) ,
0 commit comments