44//! transactions, and will likely fail if used on a populated database.
55
66use chrono:: { DateTime , Utc } ;
7- use clap:: value_t;
87use database:: pool:: { postgres, sqlite, ConnectionManager } ;
98use futures:: StreamExt ;
109use rusqlite:: params;
@@ -464,8 +463,9 @@ async fn main() -> anyhow::Result<()> {
464463
465464 let matches = clap:: App :: new ( "postgres-to-sqlite" )
466465 . about ( "Exports a rustc-perf Postgres database to a SQLite database" )
466+ . version ( clap:: crate_version!( ) )
467467 . arg (
468- clap:: Arg :: with_name ( "exclude-tables" )
468+ clap:: Arg :: new ( "exclude-tables" )
469469 . long ( "exclude-tables" )
470470 . takes_value ( true )
471471 . value_name ( "TABLES" )
@@ -474,24 +474,24 @@ async fn main() -> anyhow::Result<()> {
474474 . help ( "Exclude given tables (as foreign key constraints allow)" ) ,
475475 )
476476 . arg (
477- clap:: Arg :: with_name ( "no-self-profile" )
477+ clap:: Arg :: new ( "no-self-profile" )
478478 . long ( "no-self-profile" )
479479 . help ( "Exclude some potentially large self-profile tables (additive with --exclude-tables)" ) ,
480480 )
481481 . arg (
482- clap:: Arg :: with_name ( "since-weeks-ago" )
482+ clap:: Arg :: new ( "since-weeks-ago" )
483483 . long ( "since-weeks-ago" )
484484 . takes_value ( true )
485485 . value_name ( "WEEKS" )
486486 . help ( "Exclude data associated with artifacts whose date value precedes <WEEKS> weeks ago" ) ,
487487 )
488488 . arg (
489- clap:: Arg :: with_name ( "fast-unsafe" )
489+ clap:: Arg :: new ( "fast-unsafe" )
490490 . long ( "fast-unsafe" )
491491 . help ( "Enable faster execution at the risk of corrupting SQLite database in the event of a crash" ) ,
492492 )
493493 . arg (
494- clap:: Arg :: with_name ( "postgres-db" )
494+ clap:: Arg :: new ( "postgres-db" )
495495 . required ( true )
496496 . value_name ( "POSTGRES_DB" )
497497 . help (
@@ -500,7 +500,7 @@ async fn main() -> anyhow::Result<()> {
500500 ) ,
501501 )
502502 . arg (
503- clap:: Arg :: with_name ( "sqlite-db" )
503+ clap:: Arg :: new ( "sqlite-db" )
504504 . required ( true )
505505 . value_name ( "SQLITE_DB" )
506506 . help ( "SQLite database file" ) ,
@@ -521,7 +521,7 @@ async fn main() -> anyhow::Result<()> {
521521 // `RawSelfProfile` is intentionally kept.
522522 }
523523
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" ) {
525525 Ok ( weeks) => Some ( weeks) ,
526526 Err ( err) if err. kind == clap:: ErrorKind :: ArgumentNotFound => None ,
527527 Err ( err) => err. exit ( ) ,
0 commit comments