cliox

0.0.4 • Public • Published

Cliox

Installation

npm install cliox

Usage

'use strict';

var http = require('http');
var path = require('path');
var cliox = require('../lib/cliox');
var app = cliox();

var cli = {
  test: function (app, done) {
    app.log('info', 'info info info');
    console.log('test');
    done();
  }
};

process.title = 'example';

app
  .version('0.0.0')
  .verbose([/* alias */]) // or .silent() or .quiet()
  .format(['json', 'xml', 'yml'])
  .help(path.join(__dirname, 'docs/cli'), 'help.%s.txt')
  .option('prot', {
    type: Number,
    alias: ['-p'],
    default: 3000
  })
  .option('host', {
    type: String,
    default: 'localhost'
  });

app.bind(cli);

app.noCommand(function (app, done) {
  app.getHelpMessage(function (err, data) {
    console.log(data);
    done();
  });
});

app.run(process.argv.slice(2), function () {
  //console.log('success !');
});

Readme

Keywords

none

Package Sidebar

Install

npm i cliox

Weekly Downloads

1

Version

0.0.4

License

MIT

Last publish

Collaborators

  • poying