Skip to content

Commit c014d43

Browse files
committed
update readme
1 parent 3331c60 commit c014d43

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,15 @@ Options are variables you can accept via CLI and parse to use in your commands,
113113

114114
#### Options
115115

116-
| Name | Type | Required | Default | Example | Description |
117-
| ----------- | --------------------------------- | -------- | -------- | ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
118-
| 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. |
116+
| Name | Type | Required | Default | Example | Description |
117+
| ----------- | --------------------------------- | -------- | -------- | ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
118+
| 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+
| boolean | `boolean` || `false` | | When set to `true`, this option will be treated as a boolean: will accept no value as `true`, or other truthy values as `true`, and the rest as `false` |
123+
| array | `boolean` || `false` | | When set to true, you will be able to take multiple values when using the same option more than once. They will all be parsed properly and put into an array. |
124+
| required | `boolean` || `false` | | When an option is required, parsing will throw a `RequiredError` if it was not given a proper value. If it is attached to a specific (or several) commands, it will only throw if the relevant command was used. |
122125

123126
### Example
124127

@@ -169,12 +172,13 @@ you may override their defaults to modify the behavior.
169172
| `highlightColors` | `string \| string[]` | `"yellow"` | Colors to use on highlighted text (command names, option names, binary name, etc) |
170173
| `titleColors` | `string \| string[]` | `"white"` | Colors to use on title text ("Options", "Usage", etc) |
171174
| `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. |
175+
| `header` | `string` | | Additional content to display below the usage line, and above the rest. |
176+
| `footer` | `string` | | Additional content to display below the commands and options, at the very bottom. |
174177
| `commandNameSeparator` | `string` | `" \| "` | Separator for command name & its aliases. |
175178
| `optionNameSeparator` | `string` | `"\|"` | Separator for option name & its aliases. |
176179
| `useGlobalColumns` | `boolean` | `false` | Decides whether to align the columns of the option/command names and their descriptions globally or per table |
177180
| `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 |
181+
| `useColors` | `boolean` | `true` | When false, no colors will be output in the help. Good for non-supporting systems. |
178182

179183
### Example
180184

0 commit comments

Comments
 (0)