-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcore-v3.ts
37 lines (32 loc) · 960 Bytes
/
core-v3.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* eslint-disable perfectionist/sort-objects */
import {Args, Command, Flags, Interfaces} from '@oclif/core'
type Result = {
args: Interfaces.InferredArgs<typeof CoreV3.args>
flags: Interfaces.InferredFlags<typeof CoreV3.flags>
}
export default class CoreV3 extends Command {
static args = {
optionalArg: Args.string(),
defaultArg: Args.string({
default: 'simple string default',
}),
defaultFnArg: Args.string({
default: async () => 'async fn default',
}),
}
static enableJsonFlag = true
static flags = {
optionalString: Flags.string(),
defaultString: Flags.string({
default: 'simple string default',
}),
defaultFnString: Flags.string({
default: async () => 'async fn default',
}),
}
async run(): Promise<Result> {
const {args, flags} = await this.parse(CoreV3)
this.log(`hello I am an @oclif/core@v3 plugin from ${this.config.root}!`)
return {args, flags}
}
}