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

Commit bbfc5f7

Browse files
committed
fix: add run function
1 parent a1e2d7a commit bbfc5f7

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
"debug": "^3.1.0",
1111
"fs-extra": "^5.0.0",
1212
"load-json-file": "^4.0.0",
13-
"lodash": "^4.17.4",
14-
"tslib": "^1.9.0"
13+
"lodash": "^4.17.4"
1514
},
1615
"devDependencies": {
1716
"@anycli/config": "^1.0.3",

src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as Config from '@anycli/config'
33
import Command from './command'
44
import * as flags from './flags'
55
export {parse} from '@anycli/parser'
6-
export {Main} from './main'
6+
export {run, Main} from './main'
77

88
export default Command
99
export {

src/main.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@ import {Command} from '.'
55
export class Main extends Command {
66
static parserOptions = {'--': false, strict: false}
77

8-
static run(argv = process.argv.slice(2), opts?: Config.Options) {
9-
return super.run(argv, opts || module.parent && module.parent.parent && module.parent.parent.filename || __dirname)
8+
static run(argv = process.argv.slice(2), options?: Config.Options) {
9+
return super.run(argv, options || module.parent && module.parent.parent && module.parent.parent.filename || __dirname)
1010
}
1111

1212
async run() {
1313
const [id, ...argv] = this.argv
1414
await this.config.runCommand(id, argv)
1515
}
1616
}
17+
18+
export function run(argv = process.argv.slice(2), options?: Config.Options) {
19+
return Main.run(argv, options)
20+
}

0 commit comments

Comments
 (0)