-
Notifications
You must be signed in to change notification settings - Fork 30
/
passbolt-user.js
executable file
·38 lines (36 loc) · 1.4 KB
/
passbolt-user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* Passbolt ~ Open source password manager for teams
* Copyright (c) Passbolt SA (https://www.passbolt.com)
*
* Licensed under GNU Affero General Public License version 3 of the or any later version.
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Passbolt SA (https://www.passbolt.com)
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License
* @link https://www.passbolt.com Passbolt(tm)
*/
const {Command} = require('commander');
const UserController = require('./app/controllers/userController.js');
const UserGetView = require('./app/views/users/get.js');
/**
* User get
*/
(async function () {
const program = new Command();
program
.usage('[options] <uuid>', 'Display the info for a given user')
.option('-u, --fingerprint <fingerprint>', 'The user key fingerprint to authenticate with')
.option('-p, --passphrase <passphrase>', 'The key passphrase')
.option('-v, --verbose', 'Display additional debug information')
.parse(process.argv);
const userController = new UserController(program, process.argv);
await userController.loginIfNeeded();
try {
const data = await userController.view(program.args[0]);
const view = new UserGetView(data);
view.render();
} catch (err) {
userController.error(err);
}
})();