Ghost/ghost/pretty-cli/pretty-cli.js
Hannah Wolfe 7f234269a5 Pretty CLI - provide a styled sywac instance
- Initial commit
- Added a mini module to style sywac (http://sywac.io)
- Makes really pretty, easy to read, CLI instances
2018-09-21 13:12:12 +01:00

28 lines
773 B
JavaScript

const Api = require('sywac/api');
const styles = require('./styles');
/**
* Pretty CLI
*
* A mini-module to style a sywac instance in a standard way
*/
// Exports a pre-configured version of sywac
module.exports = Api.get()
// Use help & version with short forms AND
// group them into a Global Options group to keep them separate from per-command options
.help('-h, --help', {group: 'Global Options:'})
.version('-v, --version', {group: 'Global Options:'})
// Load our style rules
.style(styles)
// Add some padding at the end
.epilogue(' ')
// If no command is passed, output the help menu
.showHelpByDefault();
// Expose a clean version, just in case
module.exports.Api = Api;
// Export the styles
module.exports.styles = styles;