1 | export default class Argument {
|
2 |
|
3 | name: string;
|
4 |
|
5 | required: boolean;
|
6 |
|
7 | variadic: boolean;
|
8 | |
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | constructor(arg: string);
|
18 | /**
|
19 | * parse args.
|
20 | * build to opts.
|
21 | *
|
22 | * e.g. #1
|
23 | * instance member: name=foo, required=true, variadic=false
|
24 | * method arguments: opts={}, args=["foo!", "bar!"].
|
25 | * opts are modified to { foo: "foo!" } and return ["bar!"].
|
26 | *
|
27 | * e.g. #2
|
28 | * instance member: name=foo, required=false, variadic=true
|
29 | * method arguments: opts={}, args=["foo!", "bar!"].
|
30 | * opts are modified to { foo: ["foo!", "bar!"] } and return [].
|
31 | *
|
32 | * @param opts build target object
|
33 | * @param args
|
34 | * @returns {string[]} rest args
|
35 | */
|
36 | parse(opts: any, args: string[]): string[];
|
37 | }
|