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

Statements: 78.79% (26 / 33)      Branches: 75% (3 / 4)      Functions: 60% (3 / 5)      Lines: 76.67% (23 / 30)      Ignored: none     

All files » lib/parser/commands/ » wc.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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88                      1 1 1 1 1   1 1 1 1   1                                                                           1 1 1   1 1 1         1   1   1               1 1 1 1  
/*  -c, --bytes            exibe as contagens de byte
-m, --chars            exibe as contagens de caractere
-l, --lines            exibe as contagens de nova linha
--files0-from=F    ler a entrada dos ficheiros especificada por
NUL-terminated nomes no ficheiro F;
Se F é - então lê nomes da entrada padrão
-L, --max-line-length  imprimir comprimento da linha mais comprida
-w, --words            imprimir as contagens de palavras
--help     exibir esta ajuda e sair
--version  mostrar a informação de versão e sair
*/
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 GraphModule = require("../../common/graph");
 
var flags = {
    bytes: {
        name: "print byte count",
        option: 'c',
        longOption: 'bytes',
        description: "print the byte count",
        active: false
    },
    chars: {
        name: "print character count",
        option: 'm',
        longOption: 'chars',
        description: "print character count",
        active: false
    },
    line: {
        name: "print line count",
        option: 'l',
        longOption: 'lines',
        description: "print the word counts",
        active: false
    },
    word: {
        name: "print word count",
        option: 'w',
        longOption: 'words',
        description: "print the newline counts",
        active: false
    },
    longestLine: {
        name: "print longest line length",
        option: 'L',
        longOption: 'max-line-length',
        description: "print the length of the longest line",
        active: false
    }
};
 
var config = { flags: flags };
var WcData = new parserModule.ParserData(config);
var optionsParser = $.optionParserFromConfig(config);
 
var WcComponent = (function (_super) {
    __extends(WcComponent, _super);
    function WcComponent() {
        _super.apply(this, arguments);
        this.exec = "wc";
        this.files = [];
    }
    return WcComponent;
})(GraphModule.CommandComponent);
exports.WcComponent = WcComponent;
 
function defaultComponentData() {
    var graph = new WcComponent();
    graph.selectors = WcData.componentSelectors;
    graph.flags = WcData.componentFlags;
    return graph;
}
;
 
exports.parseCommand = common.commonParseCommand(optionsParser, defaultComponentData);
exports.parseComponent = common.commonParseComponent(WcData.flagOptions, WcData.selectorOptions);
exports.VisualSelectorOptions = WcData.visualSelectorOptions;
exports.componentClass = WcComponent;