public/subjects/flagger/README.md

31 lines
690 B
Markdown
Raw Permalink Normal View History

## Flagger
2020-05-29 08:59:50 +00:00
### Instructions
2020-05-29 08:59:50 +00:00
2022-06-19 20:59:12 +00:00
Create a function named `flags` that receives an object and returns the specific aliases and descriptions from the properties of that object.
2020-05-29 08:59:50 +00:00
The `help` flag:
2021-04-27 19:04:54 +00:00
2022-06-19 20:59:12 +00:00
- Must be present in the **output** by default.
2021-04-27 19:04:54 +00:00
- When not present in the input, it should return the description of all flags.
2022-06-19 20:59:12 +00:00
- When present in the input, it specifies the descriptions of the flags that are passed to `help`. (ex: `help: ['divide']`)
2020-05-29 08:59:50 +00:00
#### Example:
```js
{
multiply: 'multiply the values',
divide: 'divides the values',
help: ['divide']
}
```
2021-04-27 19:04:54 +00:00
2020-05-29 08:59:50 +00:00
and outputs :
```js
{
alias: { h: 'help', m: 'multiply', d: 'divide'}
description: '-d, --divide: divides the values',
}
```