@@ -48,7 +48,7 @@ use aptos_types::{
48
48
} ;
49
49
use aptos_vm_types:: output:: VMOutput ;
50
50
use async_trait:: async_trait;
51
- use clap:: { Parser , ValueEnum } ;
51
+ use clap:: { ArgGroup , Parser , ValueEnum } ;
52
52
use hex:: FromHexError ;
53
53
use indoc:: indoc;
54
54
use move_core_types:: {
@@ -1110,6 +1110,7 @@ impl FromStr for OptimizationLevel {
1110
1110
1111
1111
/// Options for compiling a move package dir
1112
1112
#[ derive( Debug , Clone , Parser ) ]
1113
+ #[ clap( group = ArgGroup :: new( "move-version" ) . args( & [ "move_1" , "move_2" ] ) . required( false ) ) ]
1113
1114
pub struct MovePackageDir {
1114
1115
/// Path to a move package (the folder with a Move.toml file). Defaults to current directory.
1115
1116
#[ clap( long, value_parser) ]
@@ -1179,25 +1180,33 @@ pub struct MovePackageDir {
1179
1180
1180
1181
/// ...or --compiler COMPILER_VERSION
1181
1182
/// Specify the version of the compiler.
1182
- /// Defaults to `1`, unless `--move-2` is selected.
1183
+ /// Defaults to the latest stable compiler version (at least 2)
1183
1184
#[ clap( long, value_parser = clap:: value_parser!( CompilerVersion ) ,
1184
1185
alias = "compiler" ,
1186
+ default_value = LATEST_STABLE_COMPILER_VERSION ,
1185
1187
default_value_if( "move_2" , "true" , LATEST_STABLE_COMPILER_VERSION ) ,
1188
+ default_value_if( "move_1" , "true" , "1" ) ,
1186
1189
verbatim_doc_comment) ]
1187
1190
pub compiler_version : Option < CompilerVersion > ,
1188
1191
1189
1192
/// ...or --language LANGUAGE_VERSION
1190
1193
/// Specify the language version to be supported.
1191
- /// Defaults to `1`, unless `--move-2` is selected.
1194
+ /// Defaults to the latest stable language version (at least 2)
1192
1195
#[ clap( long, value_parser = clap:: value_parser!( LanguageVersion ) ,
1193
1196
alias = "language" ,
1197
+ default_value = LATEST_STABLE_LANGUAGE_VERSION ,
1194
1198
default_value_if( "move_2" , "true" , LATEST_STABLE_LANGUAGE_VERSION ) ,
1199
+ default_value_if( "move_1" , "true" , "1" ) ,
1195
1200
verbatim_doc_comment) ]
1196
1201
pub language_version : Option < LanguageVersion > ,
1197
1202
1198
1203
/// Select bytecode, language, and compiler versions to support the latest Move 2.
1199
1204
#[ clap( long, verbatim_doc_comment) ]
1200
1205
pub move_2 : bool ,
1206
+
1207
+ /// Select bytecode, language, and compiler versions for Move 1.
1208
+ #[ clap( long, verbatim_doc_comment) ]
1209
+ pub move_1 : bool ,
1201
1210
}
1202
1211
1203
1212
impl Default for MovePackageDir {
@@ -1216,11 +1225,12 @@ impl MovePackageDir {
1216
1225
override_std : None ,
1217
1226
skip_fetch_latest_git_deps : true ,
1218
1227
bytecode_version : None ,
1219
- compiler_version : None ,
1220
- language_version : None ,
1228
+ compiler_version : Some ( CompilerVersion :: latest_stable ( ) ) ,
1229
+ language_version : Some ( LanguageVersion :: latest_stable ( ) ) ,
1221
1230
skip_attribute_checks : false ,
1222
1231
check_test_code : false ,
1223
- move_2 : false ,
1232
+ move_2 : true ,
1233
+ move_1 : false ,
1224
1234
optimize : None ,
1225
1235
experiments : vec ! [ ] ,
1226
1236
}
0 commit comments