@@ -152,13 +152,10 @@ impl Args {
152
152
153
153
fn handle_deprecated_decorator (
154
154
args_result : Result < Self , ClapError > ,
155
+ deprecated_commands : Vec < DeprecatedCommand > ,
155
156
) -> Result < Self , ClapError > {
156
157
let styles = Args :: command ( ) . get_styles ( ) . clone ( ) ;
157
- Deprecation :: handle_deprecated_commands (
158
- args_result,
159
- styles,
160
- vec ! [ DeprecatedCommand :: new( "snapshot" , "cardano-db" ) ] ,
161
- )
158
+ Deprecation :: handle_deprecated_commands ( args_result, styles, deprecated_commands)
162
159
}
163
160
}
164
161
@@ -229,7 +226,10 @@ impl ArtifactCommands {
229
226
async fn main ( ) -> MithrilResult < ( ) > {
230
227
// Load args
231
228
let args = Args :: parse_with_decorator ( & |result : Result < Args , ClapError > | {
232
- Args :: handle_deprecated_decorator ( result)
229
+ Args :: handle_deprecated_decorator (
230
+ result,
231
+ vec ! [ DeprecatedCommand :: new( "snapshot" , "cardano-db" ) ] ,
232
+ )
233
233
} ) ;
234
234
let _guard = slog_scope:: set_global_logger ( args. build_logger ( ) ?) ;
235
235
@@ -253,15 +253,4 @@ mod tests {
253
253
. await
254
254
. expect_err ( "Should fail if unstable flag missing" ) ;
255
255
}
256
-
257
- #[ test]
258
- fn snapshot_is_not_a_command_anymore ( ) {
259
- let args_result = Args :: try_parse_from ( [ "" , "snapshot" , "list" ] ) ;
260
- let result = Args :: handle_deprecated_decorator ( args_result) ;
261
-
262
- assert ! ( result. is_err( ) ) ;
263
- let message = result. err ( ) . unwrap ( ) . to_string ( ) ;
264
- assert ! ( message. contains( "'snapshot'" ) ) ;
265
- assert ! ( message. contains( "'cardano-db'" ) ) ;
266
- }
267
256
}
0 commit comments