Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upNEW: Add omit column feature #46
Open
+117
−12
Conversation
*📦 NEW: Reverse sorting flag *📦 NEW: Reverse data sorting using reverse flag *📖 DOC: Reverse sorting
Co-authored-by: Firas Dib <firas@consid.se>
*📦 NEW: NonVerbose *👌 IMPROVE: Rename option Co-authored-by: Touch Sungkawichai <mb99n@Touchs-MacBook-Pro.local> Co-authored-by: Ahmad Awais⚡️ <me@AhmadAwais.com>
--omit=cases_cases-today_wrongINput_deaths will omit all valid keys wrong keys will simply be ignored
� Conflicts: � changelog.md � index.js � package.json � utils/cli.js � utils/getCountries.js � utils/getCountry.js � utils/getStates.js
| const states = input === 'states' ? true : false; | ||
| const states = input === 'states'; |
Comment on lines
-41
to
+41
This comment has been minimized.
This comment has been minimized.
| const table = !states | ||
| ? new Table({ head, style, chars: border }) | ||
| : new Table({ head: headStates, style, chars: border }); | ||
| const tableHead = states ? headStates : head; | ||
| const table = new Table({ head: tableHead, style, chars: border }); |
Comment on lines
-48
to
+50
This comment has been minimized.
This comment has been minimized.
Inukares
Mar 25, 2020
Author
logic for table was complex - it started with negation even though there was no real reason for it. As I needed this piece of code I refactored it a little bit for easier maintenance.
| await getCountry(spinner, table, states, country); | ||
| await getStates(spinner, table, states, options); | ||
| await getCountries(spinner, table, states, country, options); | ||
| await getCountry({ spinner, table, states, country, tableHead }); | ||
| await getStates({ spinner, table, states, options, tableHead }); | ||
| await getCountries({ spinner, table, states, country, options, tableHead }); |
Comment on lines
-55
to
+57
This comment has been minimized.
This comment has been minimized.
Inukares
Mar 25, 2020
Author
Due to multiple parameters I refactored getCountry, getStates and getCountries to accept object.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Inukares commentedMar 25, 2020
•
edited
Closes #47
First of all, I'd like to say I'm extremely happy to participate in this cool project, great idea @ahmadawais!
This pull request enabled feature to omit whole column(s) from output, separated by
_.Locally running:
Wrong keys are simply ignored.