Skip to content

Instantly share code, notes, and snippets.

@jdx
Created April 2, 2015 00:01
Show Gist options
  • Save jdx/7075f00eccb95e17fb1d to your computer and use it in GitHub Desktop.
Save jdx/7075f00eccb95e17fb1d to your computer and use it in GitHub Desktop.
colors in heroku CLI plugin
'use strict';
var chalk = require('chalk');
exports.topics = [{
name: 'hello',
description: 'a topic for the hello world plugin'
}];
exports.commands = [
{
topic: 'hello',
command: 'world',
description: 'tells you hello',
help: 'help text for hello:world',
flags: [
{name: 'user', char: 'u', description: 'user to say hello to', hasValue: true}
],
run: function (context) {
if (context.args.user) {
let user = chalk.bgBlue.underline(context.args.user);
console.log(`Hello, ${user}!`);
} else {
console.log(`Hello, ${chalk.bold.magenta("World")}!`);
}
}
}
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment