1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-27 12:36:14 +01:00

move import before export

This commit is contained in:
Kyle Spearrin 2018-08-06 10:47:11 -04:00
parent 887b1f1a6d
commit 59efdbd43e

View File

@ -369,6 +369,25 @@ export class Program {
this.processResponse(response); 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 program
.command('export [password]') .command('export [password]')
.description('Export vault data to a CSV file.') .description('Export vault data to a CSV file.')
@ -390,25 +409,6 @@ export class Program {
this.processResponse(response); 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 program
.command('generate') .command('generate')
.description('Generate a password.') .description('Generate a password.')