Code coverage report for lib/parser/commands/awk.js

Statements: 100% (36 / 36)      Branches: 75% (3 / 4)      Functions: 100% (7 / 7)      Lines: 100% (33 / 33)      Ignored: none     

All files » lib/parser/commands/ » awk.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73          1 1 1 1 1   1 1 1 1 1   1                     1   1                 1   1 1 1 9 9 9 9   1   1   1 9 9 9       1   10       1 4     1 1  
/*
-f arqprog              --file=arqprog
-F fs                   --field-separator=fs
-v var=val              --assign=var=val
*/
var __extends = this.__extends || function (d, b) {
    for (var p in b) Eif (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    __.prototype = b.prototype;
    d.prototype = new __();
};
var $ = require("../utils/optionsParser");
var parserModule = require("../utils/parserData");
var common = require("../utils/init");
var sanitizer = require("../utils/sanitizer");
var GraphModule = require("../../common/graph");
 
var config = {
    parameters: {
        separator: {
            name: 'field separator',
            option: 'F',
            type: "string",
            description: "filter entries by anything other than the content",
            defaultValue: ""
        }
    }
};
var awkData = new parserModule.ParserData(config);
 
var optionsParser = {
    shortOptions: {
        F: $.setParameter(config.parameters.separator.name)
    },
    longOptions: {
        "field-separator": $.sameAs('F')
    }
};
 
$.generate(optionsParser);
 
var AwkComponent = (function (_super) {
    __extends(AwkComponent, _super);
    function AwkComponent() {
        _super.apply(this, arguments);
        this.exec = "awk";
        this.script = "";
        this.files = [];
    }
    return AwkComponent;
})(GraphModule.CommandComponent);
exports.AwkComponent = AwkComponent;
 
function defaultComponentData() {
    var component = new AwkComponent();
    component.parameters = awkData.componentParameters;
    return component;
}
;
 
exports.parseCommand = common.commonParseCommand(optionsParser, defaultComponentData, {
    string: function (component, str) {
        component.script = str;
    }
});
 
exports.parseComponent = common.commonParseComponent(awkData.flagOptions, awkData.selectorOptions, awkData.parameterOptions, function (component, exec, flags, files, parameters) {
    return exec.concat(parameters, sanitizer.sanitizeArgument(component.script)).join(' ');
});
 
exports.VisualSelectorOptions = awkData.visualSelectorOptions;
exports.componentClass = AwkComponent;