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

Statements: 100% (34 / 34)      Branches: 75% (3 / 4)      Functions: 100% (5 / 5)      Lines: 100% (31 / 31)      Ignored: none     

All files » lib/parser/commands/ » head.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 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104                    1 1 1 1 1   1 1 1 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=[-]K         print the first K bytes of each file;
with the leading '-', print all but the last
K bytes of each file
-n, --lines=[-]K         print the first K lines instead of the first 10;
with the leading '-', print all but the last
K lines of each file
-q, --quiet, --silent    nuncar mostrar cabeƧalhos com nomes de ficheiros
-v, --verbose            mostrar sempre cabeƧalhos com nomes de ficheiros
*/
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 selectors = {
    showHeaders: {
        name: 'show headers',
        description: 'show headers with file name',
        options: {
            default: {
                name: 'default',
                type: 'option',
                option: null,
                description: 'default: show headers only if tailing multiple files',
                default: true
            },
            always: {
                name: 'always',
                option: "v",
                longOption: "verbose",
                type: 'option',
                description: 'always show headers'
            },
            never: {
                name: 'never',
                type: 'option',
                option: "q",
                longOption: ['quiet', 'silent'],
                description: 'no not show headers'
            }
        }
    },
    NumOf: {
        name: 'first',
        description: 'define if first number of lines or bytes',
        options: {
            lines: {
                name: 'lines',
                type: 'numeric parameter',
                option: "n",
                default: true,
                defaultValue: 10
            },
            bytes: {
                name: 'bytes',
                type: 'numeric parameter',
                option: "b",
                defaultValue: 10
            }
        }
    }
};
 
var config = {
    selectors: selectors
};
 
var headData = new parserModule.ParserData(config);
 
var optionsParser = $.optionParserFromConfig(config);
 
var lsCommandData = new parserModule.ParserData(config);
 
var HeadComponent = (function (_super) {
    __extends(HeadComponent, _super);
    function HeadComponent() {
        _super.apply(this, arguments);
        this.exec = "head";
        this.files = [];
    }
    return HeadComponent;
})(GraphModule.CommandComponent);
exports.HeadComponent = HeadComponent;
 
function defaultComponentData() {
    var component = new HeadComponent();
    component.selectors = headData.componentSelectors;
    component.flags = headData.componentFlags;
    return component;
}
;
 
exports.parseCommand = common.commonParseCommand(optionsParser, defaultComponentData);
exports.parseComponent = common.commonParseComponent(headData.flagOptions, headData.selectorOptions);
exports.VisualSelectorOptions = headData.visualSelectorOptions;
exports.componentClass = HeadComponent;