Plato on Github
Report Home
lib/cli.js
Maintainability
70.75
Lines of code
48
Difficulty
13.44
Estimated Errors
0.28
Function weight
By Complexity
By SLOC
var _ = require('lodash'), bag = require('bagofcli'), Breaker = require('./breaker'); function _init() { console.log('Creating sample Breaker hosts file: .breaker.json'); new Breaker().init(bag.exit); } function _format(args) { args = args || {}; var opts = {}; if (args.labels) { opts.labels = args.labels.split(','); } new Breaker(opts).format(args.type || 'sshconfig', bag.exit); } function _ssh(command, args) { args = args || {}; var opts = {}; if (args.labels) { opts.labels = args.labels.split(','); } new Breaker(opts).ssh(command, bag.exit); } /** * Execute Breaker. */ function exec() { var actions = { commands: { init: { action: _init }, format: { action: _format }, ssh: { action: _ssh } } }; bag.command(__dirname, actions); } exports.exec = exec;