Plato on Github
Report Home
lib/cli.js
Maintainability
75.02
Lines of code
32
Difficulty
9.29
Estimated Errors
0.17
Function weight
By Complexity
By SLOC
var bag = require('bagofcli'); var fs = require('fs'); var Sendman = require('./sendman'); function _init() { console.log('Creating sample configuration file: .sendman.json'); new Sendman().init(bag.exit); } function _send(args, cb) { const DEFAULT_FILE = '.sendman.json'; args = args || {}; new Sendman().send(args.file || DEFAULT_FILE, bag.exit); } /** * Execute Sendman CLI. */ function exec() { var actions = { commands: { init: { action: _init }, send: { action: _send } } }; bag.command(__dirname, actions); } exports.exec = exec;