nu_plugin_prometheus 0.13.0

A nushell plugin for querying prometheus
use crate::Prometheus;
use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand};
use nu_protocol::{LabeledError, PipelineData, Signature, Type};

#[derive(Clone, Default)]
pub struct LabelCommand;

impl PluginCommand for LabelCommand {
    type Plugin = Prometheus;

    fn name(&self) -> &str {
        "prometheus label"
    }

    fn signature(&self) -> Signature {
        Signature::build(self.name()).input_output_type(Type::Nothing, Type::Nothing)
    }

    fn description(&self) -> &str {
        "Prometheus label names and values"
    }

    fn run(
        &self,
        _plugin: &Self::Plugin,
        engine: &EngineInterface,
        _call: &EvaluatedCall,
        _input: PipelineData,
    ) -> Result<PipelineData, LabeledError> {
        eprintln!("{}", engine.get_help()?);

        Ok(PipelineData::Empty)
    }
}