0.0.4 • Published 11 years ago

cliox v0.0.4

Weekly downloads
1
License
-
Repository
-
Last release
11 years ago

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 !');
});
0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago

0.0.0

11 years ago