You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| name |`string`| ✅ |`"my-command"`| The name of the command, which will be used in the CLI to trigger it |
79
+
| aliases |`string[]`| ❎ |`["m", "mc"]`| Alternate names for the command, available for use in addition to `name`|
80
+
| description |`string`| ❎ |`"Description of the command"`| Description for the command, only displayed with `--help` or `printHelp()`|
81
+
| run |`function(options) => void`| ✅ |`(options) => console.log("my-command", options)`| Main function that runs this command. The supplied argument is the options passed via the CLI and parsed by massarg. |
82
+
83
+
### Example
84
+
85
+
#### JS/TS
77
86
78
87
```typescript
79
88
massarg().command({
@@ -87,16 +96,7 @@ massarg().command({
87
96
})
88
97
```
89
98
90
-
###### Options
91
-
92
-
| Name | Type | Required | Example | Description |
| name |`string`| ✅ |`"my-command"`| The name of the command, which will be used in the CLI to trigger it |
95
-
| aliases |`string[]`| ❎ |`["m", "mc"]`| Alternate names for the command, available for use in addition to `name`|
96
-
| description |`string`| ❎ |`"Description of the command"`| Description for the command, only displayed with `--help` or `printHelp()`|
97
-
| run |`function(options) => void`| ✅ |`(options) => console.log("my-command", options)`| Main function that runs this command. The supplied argument is the options passed via the CLI and parsed by massarg. |
| name |`string`| ✅ ||`"my-number"`| The name of the option, which will be used in the CLI to apply it |
119
+
| aliases |`string[]`| ❎ ||`["n"]`| Alternate names for the option, available for use in addition to `name`|
120
+
| description |`string`| ❎ ||`"Description of the command"`| Description for the command, only displayed with `--help` or `printHelp()`|
121
+
| parse |`function(value, options) => any`| ❎ |`String`|`(value, options) => parseInt(value)`| Function that parses this option. The supplied arguments are the string value from the arg, and other options passed via the CLI and parsed by massarg before this one. Not all options will be available. |
122
+
123
+
### Example
124
+
125
+
#### JS/TS
117
126
118
127
```typescript
119
128
massarg()
@@ -135,16 +144,7 @@ massarg()
135
144
})
136
145
```
137
146
138
-
###### Options
139
-
140
-
| Name | Type | Required | Default | Example | Description |
| name |`string`| ✅ ||`"my-number"`| The name of the option, which will be used in the CLI to apply it |
143
-
| aliases |`string[]`| ❎ ||`["n"]`| Alternate names for the option, available for use in addition to `name`|
144
-
| description |`string`| ❎ ||`"Description of the command"`| Description for the command, only displayed with `--help` or `printHelp()`|
145
-
| parse |`function(value, options) => any`| ❎ |`String`|`(value, options) => parseInt(value)`| Function that parses this option. The supplied arguments are the string value from the arg, and other options passed via the CLI and parsed by massarg before this one. Not all options will be available. |
|`binName`|`string`| running script name | The name of the binary, to be used when outputting usage information. |
167
+
|`printWidth`|`number`|`80`| The amount of characters to allow per line. Use `0` to disable wrapping. |
168
+
|`normalColors`|`string \| string[]`|`"dim"`| Colors to use on normal text (descriptions, usage example, etc.) |
169
+
|`highlightColors`|`string \| string[]`|`"yellow"`| Colors to use on highlighted text (command names, option names, binary name, etc) |
170
+
|`titleColors`|`string \| string[]`|`"white"`| Colors to use on title text ("Options", "Usage", etc) |
171
+
|`subtitleColors`|`string \| string[]`|`["bold", "dim"]`| Colors to use on subtitle text (e.g. command titles for non-gloal options) |
172
+
|`header`|`string`|`"Header text"`| Additional content to display below the usage line, and above the rest. |
173
+
|`footer`|`string`|`"Footer text"`| Additional content to display below the commands and options, at the very bottom. |
174
+
|`commandNameSeparator`|`string`|`" \| "`| Separator for command name & its aliases. |
175
+
|`optionNameSeparator`|`string`|`"\|"`| Separator for option name & its aliases. |
176
+
|`useGlobalColumns`|`boolean`|`false`| Decides whether to align the columns of the option/command names and their descriptions globally or per table |
177
+
|`usageExample`|`string`|`"[command] [option]"`| Default text to use as suffix for the `binName`, which will be used in the "Usage" line of the help text |
|`binName`|`string`| running script name | The name of the binary, to be used when outputting usage information. |
188
-
|`printWidth`|`number`|`80`| The amount of characters to allow per line. Use `0` to disable wrapping. |
189
-
|`normalColors`|`string \| string[]`|`"dim"`| Colors to use on normal text (descriptions, usage example, etc.) |
190
-
|`highlightColors`|`string \| string[]`|`"yellow"`| Colors to use on highlighted text (command names, option names, binary name, etc) |
191
-
|`titleColors`|`string \| string[]`|`"white"`| Colors to use on title text ("Options", "Usage", etc) |
192
-
|`subtitleColors`|`string \| string[]`|`["bold", "dim"]`| Colors to use on subtitle text (e.g. command titles for non-gloal options) |
193
-
|`header`|`string`|`"Header text"`| Additional content to display below the usage line, and above the rest. |
194
-
|`footer`|`string`|`"Footer text"`| Additional content to display below the commands and options, at the very bottom. |
195
-
|`commandNameSeparator`|`string`|`" \| "`| Separator for command name & its aliases. |
196
-
|`optionNameSeparator`|`string`|`"\|"`| Separator for option name & its aliases. |
197
-
|`useGlobalColumns`|`boolean`|`false`| Decides whether to align the columns of the option/command names and their descriptions globally or per table |
198
-
|`usageExample`|`string`|`"[command] [option]"`| Default text to use as suffix for the `binName`, which will be used in the "Usage" line of the help text |
0 commit comments