Skip to content

Commit 5841257

Browse files
committed
add cli parameter (framework)
1 parent de5feca commit 5841257

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ generate-service-interface --source <source_directory> --output <output_director
2121

2222
- `--source`, `-s`: Specify the source directory. Default: `src`
2323
- `--output`, `-o`: Specify the output directory. Default: `dist`
24+
- `--framework`, `-f`: Specify the target framework. Options: `next` (Optional)
2425

2526
## Example
2627

src/core/arguments.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ const argv = yargs
1313
type: "string",
1414
demandOption: false,
1515
})
16+
.option("framework", {
17+
alias: "f",
18+
describe: "Specify the target framework",
19+
type: "string",
20+
demandOption: false,
21+
})
1622
.argv;
1723

1824
export default async function getArgument(name: string) {

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import resolveProperties from "./core/resolvers/property";
1616
import generateSwaggerJson from "./core/swagger";
1717

1818
(async () => {
19+
const framework = await getArgument("framework") ?? null;
20+
1921
const sourceFolder = await getArgument("source") ?? "src";
2022
const sourceDir = path.resolve(process.cwd(), sourceFolder);
2123

0 commit comments

Comments
 (0)