1
+ export class Argument {
2
+ /**
3
+ * Initialize a new command argument with the given name and description.
4
+ * The default is that the argument is required, and you can explicitly
5
+ * indicate this with <> around the name. Put [] around the name for an optional argument.
6
+ *
7
+ * @param {string } name
8
+ * @param {string } [description]
9
+ */
10
+ constructor ( name : string , description ?: string | undefined ) ;
11
+ description : string ;
12
+ variadic : boolean ;
13
+ parseArg : Function | ( ( arg : any , previous : any ) => any ) | undefined ;
14
+ defaultValue : any ;
15
+ defaultValueDescription : string | undefined ;
16
+ argChoices : string [ ] | undefined ;
17
+ required : boolean ;
18
+ _name : string ;
19
+ /**
20
+ * Return argument name.
21
+ *
22
+ * @return {string }
23
+ */
24
+ name ( ) : string ;
25
+ /**
26
+ * @package
27
+ */
28
+ _concatValue ( value : any , previous : any ) : any [ ] ;
29
+ /**
30
+ * Set the default value, and optionally supply the description to be displayed in the help.
31
+ *
32
+ * @param {any } value
33
+ * @param {string } [description]
34
+ * @return {Argument }
35
+ */
36
+ default ( value : any , description ?: string | undefined ) : Argument ;
37
+ /**
38
+ * Set the custom handler for processing CLI command arguments into argument values.
39
+ *
40
+ * @param {Function } [fn]
41
+ * @return {Argument }
42
+ */
43
+ argParser ( fn ?: Function | undefined ) : Argument ;
44
+ /**
45
+ * Only allow argument value to be one of choices.
46
+ *
47
+ * @param {string[] } values
48
+ * @return {Argument }
49
+ */
50
+ choices ( values : string [ ] ) : Argument ;
51
+ /**
52
+ * Make argument required.
53
+ */
54
+ argRequired ( ) : Argument ;
55
+ /**
56
+ * Make argument optional.
57
+ */
58
+ argOptional ( ) : Argument ;
59
+ }
60
+ /**
61
+ * Takes an argument and returns its human readable equivalent for help usage.
62
+ *
63
+ * @param {Argument } arg
64
+ * @return {string }
65
+ * @package
66
+ */
67
+ export function humanReadableArgName ( arg : Argument ) : string ;
68
+ //# sourceMappingURL=argument.d.ts.map
0 commit comments