Skip to content

Add table flag#37

Closed
duc0905 wants to merge 12 commits into
leopardslab:masterfrom
duc0905:add_table_flag
Closed

Add table flag#37
duc0905 wants to merge 12 commits into
leopardslab:masterfrom
duc0905:add_table_flag

Conversation

@duc0905

@duc0905 duc0905 commented Dec 7, 2019

Copy link
Copy Markdown

Create --table flag to print outputs in table format
Use Awsmock for testing
Change callback functions in services.js to run properly
Github link: https://github.com/duc0905/nodecloud-cli/tree/add_table_flag

Comment thread lib/helper.js Outdated
}
let finalTable = new Table({
chars: {
top: "═",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you extract these configs to a constant instead of duplicating it across both functions?

Comment thread lib/helper.js Outdated
// making the body of the table
for (prop in data) {
if (typeof data[prop] == "object") {
if (Array.isArray(data[prop])) body.push(tablerForArray(data[prop]));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use curly braces here. This is unreadable.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thank you for your advice

Comment thread lib/helper.js Outdated
} else if (typeof data == "object") {
return tablerForObject(data);
} else {
console.log(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throw an error?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think I should do so.

@duc0905 duc0905 closed this by deleting the head repository Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants