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

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

All files » lib/parser/commands/ » date.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 871 1 1 1 1   1 1 1 1   1                                       1   1 1 1   1 1 1 7 7   1   1   1 7 7 7 7       1   1     1 1 1                                                
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 config = {
    parameters: {
        date: {
            name: 'date',
            option: 'd',
            type: "string",
            description: "filter entries by anything other than the content",
            defaultValue: ""
        }
    },
    flags: {
        utc: {
            name: "UTC",
            option: 'u',
            longOption: ['utc', 'universal'],
            description: "overwrite existing output files",
            active: false
        }
    }
};
var dateData = new parserModule.ParserData(config);
 
var optionsParser = $.optionParserFromConfig(config);
optionsParser.shortOptions['d'] = $.setParameter(config.parameters.date.name);
optionsParser.longOptions['date'] = optionsParser.shortOptions['d'];
 
var DateComponent = (function (_super) {
    __extends(DateComponent, _super);
    function DateComponent() {
        _super.apply(this, arguments);
        this.exec = "date";
    }
    return DateComponent;
})(GraphModule.CommandComponent);
exports.DateComponent = DateComponent;
 
function defaultComponentData() {
    var component = new DateComponent();
    component.flags = dateData.componentFlags;
    component.parameters = dateData.componentParameters;
    return component;
}
;
 
exports.parseCommand = common.commonParseCommand(optionsParser, defaultComponentData, {
    string: function (component, str) {
        component.parameters.date = str;
    }
});
exports.parseComponent = common.commonParseComponent(dateData.flagOptions, dateData.selectorOptions, dateData.parameterOptions);
exports.VisualSelectorOptions = dateData.visualSelectorOptions;
exports.componentClass = DateComponent;
/*DESCRIPTION
Display the current time in the given FORMAT, or set the system date.
-d, --date=STRING
display time described by STRING, not 'now'
-f, --file=DATEFILE
like --date once for each line of DATEFILE
-I[TIMESPEC], --iso-8601[=TIMESPEC]
output date/time in ISO 8601 format.  TIMESPEC='date' for date only (the default), 'hours', 'minutes', 'seconds', or 'ns' for date and time to the indicated precision.
-r, --reference=FILE
display the last modification time of FILE
-R, --rfc-2822
output date and time in RFC 2822 format.  Example: Mon, 07 Aug 2006 12:34:56 -0600
--rfc-3339=TIMESPEC
output date and time in RFC 3339 format.  TIMESPEC='date', 'seconds', or 'ns' for date and time to the indicated precision.  Date and time components are separated by a sin‐
gle space: 2006-08-07 12:34:56-06:00
-s, --set=STRING
set time described by STRING
-u, --utc, --universal
print or set Coordinated Universal Time
--help display this help and exit
--version
output version information and exit
*/