Skip to content
This repository was archived by the owner on Aug 22, 2023. It is now read-only.

Commit 785f4f4

Browse files
committed
fix: fixed help command
1 parent f0c91ce commit 785f4f4

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
"semver": "^5.5.0"
1616
},
1717
"devDependencies": {
18-
"@oclif/config": "^1.3.56",
18+
"@oclif/config": "^1.3.57",
1919
"@oclif/errors": "^1.0.2",
20-
"@oclif/plugin-help": "^1.0.5",
20+
"@oclif/plugin-help": "^1.1.3",
2121
"@oclif/plugin-plugins": "^1.0.1",
2222
"@oclif/tslint": "^1.0.2",
2323
"@types/chai": "^4.1.2",

src/command.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ export default abstract class Command {
9595
}
9696

9797
protected async catch(err: any) {
98-
if (err.message.match(/Unexpected arguments?: (-h|--help)(,|\n)/)) {
98+
if (err.message.match(/Unexpected arguments?: (-h|--help|help)(,|\n)/)) {
9999
this._help()
100-
} else if (err.message.match(/Unexpected arguments?: (-v|--version)(,|\n)/)) {
100+
} else if (err.message.match(/Unexpected arguments?: (-v|--version|version)(,|\n)/)) {
101101
this._version()
102102
} else throw err
103103
}

src/main.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class Main extends Command {
2626

2727
protected _helpOverride(): boolean {
2828
if (['-v', '--version', 'version'].includes(this.argv[0])) return this._version() as any
29-
if (this.argv[0] === '-h') return true
29+
if (['-h', 'help'].includes(this.argv[0])) return true
3030
if (this.argv.length === 0) return true
3131
for (let arg of this.argv) {
3232
if (arg === '--help') return true

yarn.lock

+6-6
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
"@oclif/parser" "^3.2.9"
2323
semver "^5.5.0"
2424

25-
"@oclif/config@^1.3.56":
26-
version "1.3.56"
27-
resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.3.56.tgz#daa92087dda5fd649d4aeea9cc44aef92b854e7f"
25+
"@oclif/config@^1.3.57":
26+
version "1.3.57"
27+
resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.3.57.tgz#845ed86c01911860d49853aaab28f76c7f7a5f43"
2828

2929
"@oclif/errors@^1.0.2":
3030
version "1.0.2"
@@ -42,9 +42,9 @@
4242
dependencies:
4343
"@heroku/linewrap" "^1.0.0"
4444

45-
"@oclif/plugin-help@^1.0.5":
46-
version "1.0.5"
47-
resolved "https://registry.yarnpkg.com/@oclif/plugin-help/-/plugin-help-1.0.5.tgz#fb669c865424cb02ea0e2d3a372e58e116d2d396"
45+
"@oclif/plugin-help@^1.1.3":
46+
version "1.1.3"
47+
resolved "https://registry.yarnpkg.com/@oclif/plugin-help/-/plugin-help-1.1.3.tgz#2d0d280cb1cce485740237f029fd9a17fc568ce1"
4848
dependencies:
4949
"@oclif/command" "^1.3.1"
5050
chalk "^2.3.1"

0 commit comments

Comments
 (0)