命令行工具(未完成)
This commit is contained in:
25
bin/xss
Normal file
25
bin/xss
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 命令行工具
|
||||||
|
*
|
||||||
|
* @author 老雷<leizongmin@gmail.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
var program = require('commander');
|
||||||
|
var xss = require('../');
|
||||||
|
var packageInfo = require('../package.json');
|
||||||
|
|
||||||
|
program
|
||||||
|
.version(packageInfo.version)
|
||||||
|
.option('-t, --test', 'Active test')
|
||||||
|
.option('-i, --input <input_file>', 'Input file name')
|
||||||
|
.option('-o, --output <output_file>', 'Output filename')
|
||||||
|
.option('-c, --config <config_file>', 'Load custom config')
|
||||||
|
.parse(process.argv);
|
||||||
|
|
||||||
|
console.log(program);
|
||||||
|
|
||||||
|
if (program.test) {
|
||||||
|
require('../lib/cli');
|
||||||
|
}
|
||||||
@@ -17,12 +17,18 @@
|
|||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 0.6.0"
|
"node": ">= 0.6.0"
|
||||||
},
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"commander": "2.1.x"
|
||||||
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"mocha": "1.8.2",
|
"mocha": "1.8.2",
|
||||||
"blanket": "1.1.5",
|
"blanket": "1.1.5",
|
||||||
"browserify": "*",
|
"browserify": "*",
|
||||||
"uglify-js": "*"
|
"uglify-js": "*"
|
||||||
},
|
},
|
||||||
|
"bin": {
|
||||||
|
"xss": "./bin/xss"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"blanket": {
|
"blanket": {
|
||||||
"pattern": "xss/lib"
|
"pattern": "xss/lib"
|
||||||
|
|||||||
Reference in New Issue
Block a user