/
list.ts
40 lines (34 loc) · 1.03 KB
/
list.ts
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
39
40
import { logError, VertexError } from '@vertexvis/api-client-node';
import BaseListCommand from '../../lib/base-list';
import { vertexClient } from '../../lib/client';
import { getterFn, sceneGetter } from '../../lib/getter';
export default class List extends BaseListCommand {
public static description = `Get scenes.`;
public static examples = [
`$ vertex scenes:list
Id Name
54964c61-05d8-4f37-9638-18f7c4960c80 my-scene-1
a8070713-e48e-466b-b4bb-b3132895d5ce my-scene-2
`,
];
public static flags = BaseListCommand.flags;
public async run(): Promise<void> {
const {
flags: { cursor, extended, verbose },
} = this.parse(List);
const basePath = this.parsedFlags?.basePath;
try {
return getterFn({
all: true,
cursor,
extended,
getter: sceneGetter({
client: await vertexClient(basePath, this.userConfig),
verbose,
}),
});
} catch (error) {
logError(error as VertexError, this.error);
}
}
}