mirror of
https://github.com/bitwarden/browser
synced 2025-12-13 14:53:33 +00:00
list and get commands
This commit is contained in:
@@ -2,6 +2,8 @@ import * as program from 'commander';
|
||||
|
||||
import { LoginCommand } from './commands/login.command';
|
||||
import { SyncCommand } from './commands/sync.command';
|
||||
import { ListCommand } from './commands/list.command';
|
||||
import { GetCommand } from './commands/get.command';
|
||||
|
||||
import { Main } from './main';
|
||||
|
||||
@@ -36,7 +38,6 @@ export class Program {
|
||||
.description('Sync user\'s vault from server.')
|
||||
.option('-f, --force', 'Force a full sync.')
|
||||
.action(async (cmd) => {
|
||||
console.log('Syncing...');
|
||||
const command = new SyncCommand(this.main.syncService);
|
||||
await command.run(cmd);
|
||||
process.exit();
|
||||
@@ -45,18 +46,21 @@ export class Program {
|
||||
program
|
||||
.command('list <object>')
|
||||
.description('List objects.')
|
||||
.action((object, cmd) => {
|
||||
console.log('Listing...');
|
||||
console.log(object);
|
||||
.action(async (object, cmd) => {
|
||||
const command = new ListCommand(this.main.cipherService, this.main.folderService,
|
||||
this.main.collectionService);
|
||||
await command.run(object, cmd);
|
||||
process.exit();
|
||||
});
|
||||
|
||||
program
|
||||
.command('get <object> <id>')
|
||||
.description('Get an object.')
|
||||
.action((object, id, cmd) => {
|
||||
console.log('Getting...');
|
||||
console.log(object);
|
||||
console.log(id);
|
||||
.action(async (object, id, cmd) => {
|
||||
const command = new GetCommand(this.main.cipherService, this.main.folderService,
|
||||
this.main.collectionService, this.main.totpService);
|
||||
await command.run(object, id, cmd);
|
||||
process.exit();
|
||||
});
|
||||
|
||||
program
|
||||
|
||||
Reference in New Issue
Block a user