mirror of https://github.com/01-edu/public.git
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.
30 lines
679 B
30 lines
679 B
5 years ago
|
## flags
|
||
|
|
||
|
### Instruction
|
||
|
|
||
|
Create a function called `flags` that receives an object and outputs
|
||
|
the specific aliases and descriptions from the properties of that object.
|
||
|
|
||
|
The `help` flag:
|
||
|
- Should be present in the output by default.
|
||
|
- When not present in the input, it should output the description of all flags.
|
||
|
But when present it can specify the flags that you want to see
|
||
|
the description of. (ex: `help: ['divide']`)
|
||
|
|
||
|
#### Example:
|
||
|
|
||
|
```js
|
||
|
{
|
||
|
multiply: 'multiply the values',
|
||
|
divide: 'divides the values',
|
||
|
help: ['divide']
|
||
|
}
|
||
|
```
|
||
|
and outputs :
|
||
|
|
||
|
```js
|
||
|
{
|
||
|
alias: { h: 'help', m: 'multiply', d: 'divide'}
|
||
|
description: '-d, --divide: divides the values',
|
||
|
}
|
||
|
```
|