forked from lgwebdream/fe-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoas2code.js
More file actions
24 lines (22 loc) · 722 Bytes
/
oas2code.js
File metadata and controls
24 lines (22 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const { getCwdPath } = require('../lib/utils');
const handleOpenapi = require('../lib/api2code/openapi');
const { oasGenStatus } = require('../lib/api2code/openapi/oraState');
const oas2code = program => {
program
.command('oas2code')
.alias('o2c')
.description(
'Generates Typescript clients based on the OpenAPI specification.',
)
.requiredOption('-i, --input <input>', 'path of OpenAPI specification')
.requiredOption('-o, --output <output>', 'path of generation file')
.action(options => {
oasGenStatus.start();
const { input, output } = options;
handleOpenapi({
input,
output: getCwdPath(output),
});
});
};
module.exports = oas2code;