Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Accept 4th parameter to filter OTS input by prefix

  • Loading branch information...
commit d55f926b6c2f1818b761530c66ae1958b8537ce5 1 parent f3e3881
@codehero authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 script/json_ots.js
View
6 script/json_ots.js
@@ -1,6 +1,10 @@
var fs = require("fs");
var util = require("util");
+/* Accept line prefix parameter. */
+var prefix = "L";
+if(process.argv[3])
+ prefix = process.argv[3];
fs.readFile(process.argv[2], "utf8", function(err, data){
if(err)
@@ -12,7 +16,7 @@ fs.readFile(process.argv[2], "utf8", function(err, data){
var lines = data.split("\n");
lines.forEach(function(line){
/* Skip blank lines or lines without 'L' at beginning. */
- if(!line.length || line.charAt(0) != "L")
+ if(!line.length || line.charAt(0) != prefix.charAt(0))
return;
/* Make sure there is an '=' sign */
Please sign in to comment.
Something went wrong with that request. Please try again.