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.')