Exemple #1
0
        public RenderCommand(SeqConnectionFactory connectionFactory, SeqCliConfig config)
        {
            if (config == null)
            {
                throw new ArgumentNullException(nameof(config));
            }
            _connectionFactory = connectionFactory ?? throw new ArgumentNullException(nameof(connectionFactory));

            Options.Add(
                "i=|id=",
                "The id of a single dashboard to render",
                t => _id = ArgumentString.Normalize(t));
            Options.Add("c=|chart=", "The title of a chart on the dashboard to render",
                        c => _chartTitle = ArgumentString.Normalize(c));
            Options.Add("last=",
                        "A duration over which the chart should be rendered, e.g. `7d`; this will be aligned to an interval boundary; either `--last` or `--start` and `--end` must be specified",
                        v => _lastDuration = ArgumentString.Normalize(v));
            Options.Add("by=",
                        "The time-slice interval for the chart data, as a duration, e.g. `1h`",
                        v => _intervalDuration = ArgumentString.Normalize(v));
            _range      = Enable <DateRangeFeature>();
            _signal     = Enable <SignalExpressionFeature>();
            _timeout    = Enable <TimeoutFeature>();
            _output     = Enable(new OutputFormatFeature(config.Output));
            _connection = Enable <ConnectionFeature>();
        }
Exemple #2
0
 public QueryCommand(SeqConnectionFactory connectionFactory, SeqCliConfig config)
 {
     if (config == null)
     {
         throw new ArgumentNullException(nameof(config));
     }
     _connectionFactory = connectionFactory ?? throw new ArgumentNullException(nameof(connectionFactory));
     Options.Add("q=|query=", "The query to execute", v => _query = v);
     _range      = Enable <DateRangeFeature>();
     _signal     = Enable <SignalExpressionFeature>();
     _timeout    = Enable <TimeoutFeature>();
     _output     = Enable(new OutputFormatFeature(config.Output));
     _connection = Enable <ConnectionFeature>();
 }