UNPKG

rainbow-cli

Version:

Rainbow CLI application based on the Rainbow SDK for Node.js

40 lines (30 loc) 887 B
"use strict"; var CBusiness = require('../commands/CBusiness'); var Logger = require('../common/Logger'); var Middleware = require('../common/Middleware'); class Business { constructor(program, prefs) { this._program = program; this._prefs = prefs; this._business = new CBusiness(this._prefs); } start() { this.listOfCommands() } stop() { } listOfCommands() { var that = this; this._program.command('business set-premium', '<id>') .description("Change the company offer type to premium") .option('-v, --verbose', 'Use verbose console mode') .action(function (id, commands) { Middleware.parseCommand(commands).then( () => { Logger.isActive = commands.verbose || false; that._business.changeOfferTypeToPremium(id); }).catch( () => { }); }); } } module.exports = Business;