How to use the @twilio/cli-core.BaseCommand.flags 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 / commands / profiles / use.js View on Github external
const configSavedMessage = await this.configFile.save(this.userConfig);
    this.logger.info(`set "${profile.id}" as active profile`);
    this.logger.info(configSavedMessage);
  }
}

ProfilesUse.description = 'select which profile to use';

ProfilesUse.args = [
  {
    name: 'profile',
    description: 'Shorthand identifier for your profile',
    required: true
  }
];
ProfilesUse.flags = BaseCommand.flags;

module.exports = ProfilesUse;
github twilio / twilio-cli / src / commands / projects / list.js View on Github external
}
      const activeProject = this.userConfig.getActiveProject();
      this.userConfig.projects.forEach(p => {
        if (p.id === activeProject.id) {
          p.active = true;
        }
      });
      this.output(this.userConfig.projects);
    } else {
      this.logger.warn('No projects have been configured. Run ' + chalk.whiteBright('twilio projects:add') + ' to add one!');
    }
  }
}

ProjectsList.description = 'show what Twilio projects you have configured';
ProjectsList.flags = BaseCommand.flags;

module.exports = ProjectsList;
github twilio / twilio-cli / src / commands / email / send.js View on Github external
}),
    subject: flags.string({
      description: 'The subject line for an email.'
    }),
    text: flags.string({
      description: 'Text to send within the email body.'
    }),
    attachment: flags.string({
      description: 'Path for the file that you want to attach.'
    }),
    'force-tty': flags.boolean({
      default: false,
      hidden: true
    })
  },
  BaseCommand.flags
);
Send.args = [];

module.exports = Send;
github twilio / twilio-cli / src / commands / zork.js View on Github external
class Zork extends BaseCommand {
  async run() {
    await super.run();

    try {
      const zork = await this.install('zorkjs');
      zork();
    } catch (error) {
      this.logger.debug('Error loading zork: ' + JSON.stringify(error));
      throw new TwilioCliError('I don\'t know the word "zork".');
    }
  }
}

Zork.description = 'what could this be?';
Zork.flags = BaseCommand.flags;
Zork.hidden = true;

module.exports = Zork;
github twilio / twilio-cli / src / commands / profiles / list.js View on Github external
}
      const activeProfile = this.userConfig.getActiveProfile();
      this.userConfig.profiles.forEach(p => {
        if (p.id === activeProfile.id) {
          p.active = true;
        }
      });
      this.output(this.userConfig.profiles);
    } else {
      this.logger.warn('No profiles have been configured. Run ' + chalk.whiteBright('twilio profiles:create') + ' to create one!');
    }
  }
}

ProfilesList.description = 'show what profiles you have configured';
ProfilesList.flags = BaseCommand.flags;

module.exports = ProfilesList;