Skip to content

Commit 8249e23

Browse files
committed
update readme
1 parent c014d43 commit 8249e23

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ will be executed, skipping the rest. Options will still be parsed.
7373

7474
#### Options
7575

76-
| Name | Type | Required | Example | Description |
77-
| ----------- | --------------------------- | -------- | ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
78-
| 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. |
76+
| Name | Type | Required | Example | Description |
77+
| ------------- | --------------------------- | -------- | ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
78+
| `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. |
8282

8383
### Example
8484

@@ -113,15 +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. |
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. |
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. |
125125

126126
### Example
127127

0 commit comments

Comments
 (0)