4
4
//! transactions, and will likely fail if used on a populated database.
5
5
6
6
use chrono:: { DateTime , Utc } ;
7
- use clap:: value_t;
8
7
use database:: pool:: { postgres, sqlite, ConnectionManager } ;
9
8
use futures:: StreamExt ;
10
9
use rusqlite:: params;
@@ -464,8 +463,9 @@ async fn main() -> anyhow::Result<()> {
464
463
465
464
let matches = clap:: App :: new ( "postgres-to-sqlite" )
466
465
. about ( "Exports a rustc-perf Postgres database to a SQLite database" )
466
+ . version ( clap:: crate_version!( ) )
467
467
. arg (
468
- clap:: Arg :: with_name ( "exclude-tables" )
468
+ clap:: Arg :: new ( "exclude-tables" )
469
469
. long ( "exclude-tables" )
470
470
. takes_value ( true )
471
471
. value_name ( "TABLES" )
@@ -474,24 +474,24 @@ async fn main() -> anyhow::Result<()> {
474
474
. help ( "Exclude given tables (as foreign key constraints allow)" ) ,
475
475
)
476
476
. arg (
477
- clap:: Arg :: with_name ( "no-self-profile" )
477
+ clap:: Arg :: new ( "no-self-profile" )
478
478
. long ( "no-self-profile" )
479
479
. help ( "Exclude some potentially large self-profile tables (additive with --exclude-tables)" ) ,
480
480
)
481
481
. arg (
482
- clap:: Arg :: with_name ( "since-weeks-ago" )
482
+ clap:: Arg :: new ( "since-weeks-ago" )
483
483
. long ( "since-weeks-ago" )
484
484
. takes_value ( true )
485
485
. value_name ( "WEEKS" )
486
486
. help ( "Exclude data associated with artifacts whose date value precedes <WEEKS> weeks ago" ) ,
487
487
)
488
488
. arg (
489
- clap:: Arg :: with_name ( "fast-unsafe" )
489
+ clap:: Arg :: new ( "fast-unsafe" )
490
490
. long ( "fast-unsafe" )
491
491
. help ( "Enable faster execution at the risk of corrupting SQLite database in the event of a crash" ) ,
492
492
)
493
493
. arg (
494
- clap:: Arg :: with_name ( "postgres-db" )
494
+ clap:: Arg :: new ( "postgres-db" )
495
495
. required ( true )
496
496
. value_name ( "POSTGRES_DB" )
497
497
. help (
@@ -500,7 +500,7 @@ async fn main() -> anyhow::Result<()> {
500
500
) ,
501
501
)
502
502
. arg (
503
- clap:: Arg :: with_name ( "sqlite-db" )
503
+ clap:: Arg :: new ( "sqlite-db" )
504
504
. required ( true )
505
505
. value_name ( "SQLITE_DB" )
506
506
. help ( "SQLite database file" ) ,
@@ -521,7 +521,7 @@ async fn main() -> anyhow::Result<()> {
521
521
// `RawSelfProfile` is intentionally kept.
522
522
}
523
523
524
- let since_weeks_ago = match clap :: value_t! ( matches, "since-weeks-ago" , u32 ) {
524
+ let since_weeks_ago = match matches. value_of_t ( "since-weeks-ago" ) {
525
525
Ok ( weeks) => Some ( weeks) ,
526
526
Err ( err) if err. kind == clap:: ErrorKind :: ArgumentNotFound => None ,
527
527
Err ( err) => err. exit ( ) ,
0 commit comments