parent
f79e838095
commit
40973641a3
|
@ -13,11 +13,17 @@ const argv = minimist(process.argv.slice(2), {
|
||||||
"flow-parser",
|
"flow-parser",
|
||||||
"bracket-spacing",
|
"bracket-spacing",
|
||||||
"single-quote",
|
"single-quote",
|
||||||
"trailing-comma"
|
"trailing-comma",
|
||||||
|
"version"
|
||||||
],
|
],
|
||||||
default: { "bracket-spacing": true }
|
default: { "bracket-spacing": true }
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (argv["version"]) {
|
||||||
|
console.log(jscodefmt.version);
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
const filenames = argv["_"];
|
const filenames = argv["_"];
|
||||||
const write = argv["write"];
|
const write = argv["write"];
|
||||||
const stdin = argv["stdin"];
|
const stdin = argv["stdin"];
|
||||||
|
|
4
index.js
4
index.js
|
@ -3,6 +3,7 @@ const babylon = require("babylon");
|
||||||
const Printer = require("./src/printer").Printer;
|
const Printer = require("./src/printer").Printer;
|
||||||
const flowParser = require("flow-parser");
|
const flowParser = require("flow-parser");
|
||||||
const comments = require("./src/comments");
|
const comments = require("./src/comments");
|
||||||
|
const version = require('./package.json').version;
|
||||||
|
|
||||||
var babylonOptions = {
|
var babylonOptions = {
|
||||||
sourceType: "module",
|
sourceType: "module",
|
||||||
|
@ -74,5 +75,6 @@ function formatWithShebang(text, opts) {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
format: function(text, opts) {
|
format: function(text, opts) {
|
||||||
return formatWithShebang(text, opts);
|
return formatWithShebang(text, opts);
|
||||||
}
|
},
|
||||||
|
version: version
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue