Created
April 2, 2015 00:01
-
-
Save jdx/7075f00eccb95e17fb1d to your computer and use it in GitHub Desktop.
colors in heroku CLI plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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