Skip to content

Commit 84d6c6c

Browse files
committed
📦 NEW: Help
1 parent 4ede7d1 commit 84d6c6c

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ const sortBy = cli.flags.sort;
2525
// Init.
2626
init();
2727
const [country] = cli.input;
28+
if (country === 'help') {
29+
cli.showHelp(0);
30+
}
2831

2932
// Table
3033
const head = xcolor ? single : colored;

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ corona china
6565
corona usa
6666

6767
# Display the help data.
68+
corona help
6869
corona --help
6970
```
7071

utils/getCountry.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ const green = chalk.green;
77

88
module.exports = async (spinner, table, country) => {
99
if (country) {
10-
if (country === 'help') {
11-
spinner.stopAndPersist();
12-
console.log(`${red(`${logSymbols.error} Nops. For help run "${green(`corona --help`)}" command`)}\n`);
13-
process.exit(1);
14-
}
1510
const api = await axios.get(`https://corona.lmao.ninja/countries/${country}`);
1611
if (api.data === 'Country not found') {
1712
spinner.stopAndPersist();

0 commit comments

Comments
 (0)