Skip to content

Commit

Permalink
feat: add -v flag + fix semantic-release thing
Browse files Browse the repository at this point in the history
  • Loading branch information
andenacitelli committed Apr 21, 2023
1 parent 87b9fe7 commit 346a636
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@ program
.option("-i, --input <input>", "Input File (Local or Absolute Path). (Required: Either this or --url).")
.option("-u, --url <URL>", "Input URL")
.option("-o, --output <output>", "Output File")
.option("-v, --version", "Display the current version.")
.option("-p, --paths <path>", "A comma-separated, zero-spaces list of paths to keep. (Ex. /api/v1/users,/api/v1/organizations)")
.option("--help", "Display all flags, commands, and descriptions.");
program.parse();
if (program.opts().help) {
program.help();
process.exit(0);
}
if (program.opts().version) {
console.log(process.env.npm_package_version);
process.exit(0);
}
const options = z
.object({
input: z.string().optional(),
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openapi-endpoint-trimmer",
"version": "1.0.0",
"version": "1.0.2",
"description": "",
"main": "./bin/index.js",
"bin": "./bin/index.js",
Expand Down Expand Up @@ -82,6 +82,7 @@
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/npm",
[
"@semantic-release/git",
{
Expand All @@ -93,7 +94,7 @@
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
"@semantic-release/npm"
"@semantic-release/github"
]
}
}
6 changes: 6 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ program
)
.option("-u, --url <URL>", "Input URL")
.option("-o, --output <output>", "Output File")
.option("-v, --version", "Display the current version.")
.option(
"-p, --paths <path>",
"A comma-separated, zero-spaces list of paths to keep. (Ex. /api/v1/users,/api/v1/organizations)"
Expand All @@ -35,6 +36,11 @@ if (program.opts().help) {
process.exit(0);
}

if (program.opts().version) {
console.log(process.env.npm_package_version);
process.exit(0);
}

const options = z
.object({
input: z.string().optional(),
Expand Down

0 comments on commit 346a636

Please sign in to comment.