How to use the @twilio/cli-core.TwilioClientCommand.limitFlags function in @twilio/cli-core

To help you get started, we’ve selected a few @twilio/cli-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github twilio / twilio-cli / src / base-commands / twilio-api-command.js View on Github external
});

  // 'remove' commands have no response body and thus do not need display properties.
  if (NewCommandClass.actionDefinition.commandName !== 'remove') {
    const defaultProperties = (resource && resource.defaultOutputProperties) || [];

    cmdFlags.properties = flags.string({
      // Camel-cased, CSV of the provided property list. Or just the SID.
      default: defaultProperties.map(prop => camelCase(prop)).join(',') || 'sid',
      description: 'The properties you would like to display (JSON output always shows all properties).'
    });
  }

  // 'list' commands get limit flags for specifying the result set size.
  if (NewCommandClass.actionDefinition.commandName === 'list') {
    cmdFlags = Object.assign(cmdFlags, TwilioClientCommand.limitFlags);
  }

  // Class statics
  NewCommandClass.id = commandId;
  NewCommandClass.args = [];
  NewCommandClass.flags = Object.assign(cmdFlags, TwilioApiCommand.flags);
  NewCommandClass.description = getActionDescription(NewCommandClass.actionDefinition);
  NewCommandClass.load = () => NewCommandClass;

  return NewCommandClass;
};