Skip to content

Interface: ArgToken ​

Argument token.

Signature ​

ts
interface ArgToken

Properties ​

NameTypeDescription
indexnumberArgument token index, e.g --foo bar => --foo index is 0, bar index is 1.
inlineValue (optional)boolean | undefinedInline value, e.g. --foo=bar => true, -x=bar => true, -x-1 => false, since no = is written. Unlike Node.js parseArgs, false does not mean that the value is the next argument: the value token of -x-1 has the index of that argument.
kindArgTokenKindArgument token kind.
name (optional)stringOption name, e.g. --foo => foo, -x => x.
rawName (optional)stringRaw option name, e.g. --foo => --foo, -x => -x.
value (optional)string | undefinedOption value, e.g. --foo=bar => bar. The value of a short option, such as bar of -x=bar, -1 of -x=-1 or -x-1, and '' of -x=, is in a token of its own after the option, which has no name and rawName. If the allowCompatible option is true, short option value will be same as Node.js parseArgs behavior.

Released under the MIT License.