nu_plugin_nw_ulid 0.1.3

Production-grade ULID (Universally Unique Lexicographically Sortable Identifier) utilities plugin for Nushell with cryptographically secure operations, enterprise-grade security, and streaming support
Documentation
use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand};
use nu_protocol::{Example, LabeledError, PipelineData, Signature, Value};

use crate::UlidPlugin;

pub struct UlidInfoCommand;

impl PluginCommand for UlidInfoCommand {
    type Plugin = UlidPlugin;

    fn name(&self) -> &str {
        "ulid info"
    }

    fn description(&self) -> &str {
        "Display plugin metadata and diagnostics"
    }

    fn signature(&self) -> Signature {
        Signature::build(self.name())
    }

    fn examples(&self) -> Vec<Example<'_>> {
        vec![Example {
            example: "ulid info",
            description: "Show plugin information",
            result: None,
        }]
    }

    fn run(
        &self,
        _plugin: &Self::Plugin,
        _engine: &EngineInterface,
        call: &EvaluatedCall,
        _input: PipelineData,
    ) -> Result<PipelineData, LabeledError> {
        let record = Value::record(
            [
                ("name".into(), Value::string("nu_plugin_nw_ulid", call.head)),
                (
                    "version".into(),
                    Value::string(env!("CARGO_PKG_VERSION"), call.head),
                ),
                (
                    "description".into(),
                    Value::string(env!("CARGO_PKG_DESCRIPTION"), call.head),
                ),
                (
                    "authors".into(),
                    Value::string(env!("CARGO_PKG_AUTHORS"), call.head),
                ),
                (
                    "license".into(),
                    Value::string(env!("CARGO_PKG_LICENSE"), call.head),
                ),
                (
                    "repository".into(),
                    Value::string(env!("CARGO_PKG_REPOSITORY"), call.head),
                ),
            ]
            .into_iter()
            .collect(),
            call.head,
        );

        Ok(PipelineData::Value(record, None))
    }
}