From 59efdbd43e3d9a88e3a51bba19a84384bd0176b0 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 6 Aug 2018 10:47:11 -0400 Subject: [PATCH] move import before export --- src/program.ts | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/program.ts b/src/program.ts index d6a362f457..4ae9a283c2 100644 --- a/src/program.ts +++ b/src/program.ts @@ -369,6 +369,25 @@ export class Program { this.processResponse(response); }); + program + .command('import [format] [input] [password]') + .description('Import vault data from a file.') + .option('--formats', 'List formats') + .on('--help', () => { + writeLn('\n Examples:'); + writeLn(''); + writeLn(' bw import --formats'); + writeLn(' bw import bitwardencsv ./from/source.csv'); + writeLn(' bw import keepass2xml keepass_backup.xml myPassword123'); + }) + .action(async (format, filepath, password, cmd) => { + await this.exitIfLocked(); + const command = new ImportCommand(this.main.cryptoService, + this.main.userService, this.main.importService); + const response = await command.run(format, filepath, password, cmd); + this.processResponse(response); + }); + program .command('export [password]') .description('Export vault data to a CSV file.') @@ -390,25 +409,6 @@ export class Program { this.processResponse(response); }); - program - .command('import [format] [input] [password]') - .description('Import vault data from a file.') - .option('--formats', 'List formats') - .on('--help', () => { - writeLn('\n Examples:'); - writeLn(''); - writeLn(' bw import --formats'); - writeLn(' bw import bitwardencsv ./from/source.csv'); - writeLn(' bw import keepass2xml keepass_backup.xml myPassword123'); - }) - .action(async (format, filepath, password, cmd) => { - await this.exitIfLocked(); - const command = new ImportCommand(this.main.cryptoService, - this.main.userService, this.main.importService); - const response = await command.run(format, filepath, password, cmd); - this.processResponse(response); - }); - program .command('generate') .description('Generate a password.')