Giter VIP home page Giter VIP logo

covid19-cli's Introduction

_________             .__    ._______ ________          _________ .____    .___ 
\_   ___ \  _______  _|__| __| _/_   /   __   \         \_   ___ \|    |   |   |
/    \  \/ /  _ \  \/ /  |/ __ | |   \____    /  ______ /    \  \/|    |   |   |
\     \___(  <_> )   /|  / /_/ | |   |  /    /  /_____/ \     \___|    |___|   |
\______  /\____/ \_/ |__\____ | |___| /____/            \______  /_______ \___|
       \/                    \/                                \/        \/        
       
Corona Virus (Covid-19) statistics cli.

MIT License
Copyright (c) 2020 Garry Lachman
https://github.com/garrylachman/covid19-cli

Options:
 -c, --country     Specific Country (actual data + historical)
 -l, --list-all    List all countries
 -s, --sort        Sort countries list by key (country|cases|active|critical|deaths|recovered|todayCases|todayDeaths|casesPerOneMillion)
 -i, --historical  List all countries historical trend chart 
 -h, --help        Display this help and exit
 -n, --no-banner   Hides "Covid19-CLI" banner
     --version     Output version information and exit

Usage

Please download the "compiled" version from Releases tab

bash covid19-cli.sh -h

Or if you prefer to make it executable:

chmod +x covid19-cli.sh
./covid19-cli.sh -h

Build

  1. git clone https://github.com/garrylachman/covid19-cli.git
  2. cd cd covid19-cli
  3. make

The compiled file is located at dist directory

Screenshots

Screenshot 1 Screenshot 2

Dependencies

Credits

Ego Boosters

GitHub GitHub All Releases GitHub tag (latest by date) GitHub Release Date GitHub contributors Analytics

covid19-cli's People

Contributors

a14m avatar garrylachman avatar jakobfp avatar janbrezina avatar jm2dev avatar northbear avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

covid19-cli's Issues

'cannot change locale'; 'printf: null: invalid number'

Describe the bug

covid19-cli.sh: line 9: warning: setlocale: LC_NUMERIC: cannot change locale (en_US): No such file or directory
 ✔  Country: united states
jq: error (at <stdin>:1): Cannot iterate over null (null)
jq: error (at <stdin>:1): Cannot iterate over null (null)

[my path]/covid19-cli.sh: line 411: printf: null: invalid number
Cases:		0	
[my path]/covid19-cli/dist/covid19-cli.sh: line 412: printf: null: invalid number
Deaths:		0	
[my path]/covid19-cli/dist/covid19-cli.sh: line 413: printf: null: invalid number
Recovered:	0

To Reproduce
Run the program with seeminly any option.

Expected behavior
A clear and concise description of what you expected to happen.

Desktop:

  • OS: [e.g. iOS]
    Linux Mint 19.3 x64 Cinnamon

Software versions
GNU bash, version 4.4.20(1)-release (x86_64-pc-linux-gnu)
Latest git version of covid19-cli

Additional context
I think it is a problem with the data source - for, a similar program that I have has a similar problem - but your program should handle the problem more gracefully.

Country option is not working

When i try the country option it just prints the Global Statistics:

$ bash covid19-cli.sh --country USA
✔ Global Statistics
Cases: 252773, Deaths: 10405, Recovered: 89060

Works with bash but not sh

if I run it with bash it's is working now but if I run it as an executable I get a script error.
I'm on Ubuntu 18.04.4
changing first line to "#!/usr/bin/env bash" did fix the issue

$ ./covid19-cli.sh
./covid19-cli.sh: 16: ./covid19-cli.sh: [[: not found
./covid19-cli.sh: 19: ./covid19-cli.sh: Syntax error: "(" unexpected

$ bash covid19-cli.sh
✔ Global Statistics
Cases: 255733, Deaths: 10495, Recovered: 89918

$ bash covid19-cli.sh --country=USA
✔ Country: USA
Cases: 14373, Deaths: 218, Recovered: 125

Globbing problems? See shellcheck

The shellcheck program (available for editors and also online at https://www.shellcheck.net/) is unhappy with various parts of the main script (viz., covid19-cli.sh). Many of those problems have to do with 'globbing' and I wonder whether here we have the source of #15.

Desktop:

  • OS: Mint 19.3 x64 Cinnamon

Software versions

  • Bash version: [e.g 3.2.57] 4.4.20(1)-release (x86_64-pc-linux-gnu)

Countries with subtitle not parsing correctly

command line: ~/covid19-cli $ ./dist/covid19-cli.sh -l --sort deaths

rough description: Country subtitles(?) are displayed under "cases" column and all remaining values for those countries seem to be shifted one column to the right in display.

output snippets:

| China | 81285 | 3947 | 1235 | 3287 | 74051 | 67 | 6 | 56 |
| Iran | Islamic Republic of | 29406 | 16715 | 2746 | 2234 | 10457 | 2389 | 157 | 350 |
| France | 29155 | 22511 | 3375 | 1696 | 4948 | 3922 | 365 | 447 |

| Andorra | 224 | 220 | 6 | 3 | 1 | 36 | 2 | 2 |
| Macedonia | the former Yugoslav Republic of | 201 | 195 | 1 | 3 | 3 | 24 | 0 | 96 |
| Congo | the Democratic Republic of the | 51 | 48 | 0 | 3 | 0 | 3 | 1 | 0.6 |
| Russia | 840 | 799 | 8 | 3 | 38 | 182 | 0 | 6 |

editing to add:

  • gentoo kernel 4.19 amd64
  • bash 4.4
  • coreutils 8.31

edit(2) to add '-l' to cmd line above

All stats are zero when searching for a country

Describe the bug
All stats are zero when searching for a country

To Reproduce
Steps to reproduce the behavior:
1.'./covid19-cli.sh -c Netherlands'
2. See error

Expected behavior
It probably should show other numbers than 0

Screenshots
./covid19-cli.sh -c Netherlands

Desktop:

  • OS: [KDE NEON]

Software versions

  • Bash version: [4.4.20]

Explain mor eclearly in help how to select country, and report country name

Hello!

It would be nice to explain, in the help text, how the user should enter the country (two-letter abbreviation? full name? how would I know exactly how to enter some country?)

Also, it would be nice, perhaps, to report the full country name in the output:

./covid19-cli.sh -c aa
...
 ✔  Country: aa
Cases: 1, Deaths: 0, Recovered: 0

Hm, but what is the user is not sure if aa is really the country she wanted to select?

Add punctuation to the numbers in the output

Is your feature request related to a problem? Please describe.
I'm always frustrated when interpreting the output is hard because the output lacks punctuation.

Describe the solution you'd like
Add punctuation to the output. Thus, 10000 should be 10,000 or - depending on the locale - 10.000. I imagine that BASH should make it fairly easy to make the change.

Describe alternatives you've considered
I can think of no alternative remedy for the problem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.