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 |
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: 'last',
description: 'define if last 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 tailData = new parserModule.ParserData(config);
var optionsParser = $.optionParserFromConfig(config);
var TailComponent = (function (_super) {
__extends(TailComponent, _super);
function TailComponent() {
_super.apply(this, arguments);
this.exec = "tail";
this.files = [];
}
return TailComponent;
})(GraphModule.CommandComponent);
exports.TailComponent = TailComponent;
function defaultComponentData() {
var component = new TailComponent();
component.selectors = tailData.componentSelectors;
component.flags = tailData.componentFlags;
return component;
}
;
exports.parseCommand = common.commonParseCommand(optionsParser, defaultComponentData);
exports.parseComponent = common.commonParseComponent(tailData.flagOptions, tailData.selectorOptions);
exports.VisualSelectorOptions = tailData.visualSelectorOptions;
exports.componentClass = TailComponent;
|