-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathget.js
38 lines (30 loc) · 838 Bytes
/
get.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
'use strict';
const { Args } = require('@oclif/core');
const BoxCommand = require('../../box-command');
class UsersGetCommand extends BoxCommand {
async run() {
const { flags, args } = await this.parse(UsersGetCommand);
let options = {};
if (flags.fields) {
options.fields = flags.fields;
}
let user = await this.client.users.get(args.id, options);
await this.output(user);
}
}
UsersGetCommand.description = 'Get information about a Box user';
UsersGetCommand.examples = ['box users:get 33333'];
UsersGetCommand._endpoint = 'get_users_id';
UsersGetCommand.flags = {
...BoxCommand.flags
};
UsersGetCommand.args = {
id: Args.string({
name: 'id',
required: false,
hidden: false,
default: 'me',
description: 'ID of the user to get; defaults to the current user',
}),
};
module.exports = UsersGetCommand;