You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
690 B

## Flagger
5 years ago
### Instructions
5 years ago
Create a function named `flags` that receives an object and returns the specific aliases and descriptions from the properties of that object.
5 years ago
The `help` flag:
- Must be present in the **output** by default.
- When not present in the input, it should return the description of all flags.
- When present in the input, it specifies the descriptions of the flags that are passed to `help`. (ex: `help: ['divide']`)
5 years ago
#### Example:
```js
{
multiply: 'multiply the values',
divide: 'divides the values',
help: ['divide']
}
```
5 years ago
and outputs :
```js
{
alias: { h: 'help', m: 'multiply', d: 'divide'}
description: '-d, --divide: divides the values',
}
```