Ghost/ghost/pretty-cli/lib/pretty-cli.js
Hannah Wolfe 66f1ddcbe9 🎨 Update to use files array in package.json
- run `slimer fix package.json` to add a files array everywhere
- manually update slimer-cli to have a files array for bin
- manually update slimer to include commands or else this will break!!
- update pretty-cli to use our standard /lib/ pattern
- this means we only publish what we need to npm, and keeps things cleaner and safer
2018-11-29 16:04:13 +00:00

31 lines
848 B
JavaScript

const Api = require('sywac/api');
const styles = require('./styles');
const ui = require('./ui');
/**
* 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;
// Export our ui tools
module.exports.ui = ui;