1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 00:03:56 +00:00

command structure. debugging

This commit is contained in:
Kyle Spearrin
2018-05-12 15:12:28 -04:00
parent 4a0fa7945a
commit bb54e2a381
6 changed files with 135 additions and 6 deletions

View File

@@ -1,17 +1,20 @@
import * as program from 'commander';
import { AuthService } from 'jslib/services/auth.service';
import { LoginCommand } from './commands/login.command';
program
.version('1.0.0', '-v, --version');
program
.command('login <email> <password>')
.description('Log into a Bitwarden user account.')
.option('-t, --two_factor <code>', '2FA code.')
.action((email, password, cmd) => {
console.log('Logging in...');
console.log(email);
console.log(password);
console.log(cmd.two_factor);
.option('-m, --method <method>', '2FA method.')
.option('-c, --code <code>', '2FA code.')
.action((email: string, password: string, cmd: program.Command) => {
const command = new LoginCommand(null);
command.run(email, password, cmd);
});
program