Skip to content

Commit

Permalink
feat: Add flag no header for list and fetch commands (twilio#182)
Browse files Browse the repository at this point in the history
* feat: Added --no-header flag for list commands

* Name change in description.
  • Loading branch information
ravali-rimmalapudi committed Dec 3, 2021
1 parent 16ee681 commit 22f6ea9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/base-commands/base-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ class BaseCommand extends Command {
}

output(fullData, properties, options) {
if (this.flags['no-header']) {
if (options) {
options.showHeaders = false;
} else {
options = { showHeaders: false };
}
}
if (!this.outputProcessor) {
// Silenced output
return;
Expand Down
6 changes: 6 additions & 0 deletions src/base-commands/twilio-client-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,10 @@ TwilioClientCommand.limitFlags = {
}),
};

TwilioClientCommand.noHeader = {
'no-header': flags.boolean({
description: 'Skip including of headers while listing the data.',
}),
};

module.exports = TwilioClientCommand;

0 comments on commit 22f6ea9

Please sign in to comment.