Skip to main content

VERSION

Static VERSION 

Source
pub static VERSION: OnceLock<Version>
Expand description

Static container for the version shown by the version command.

By default, this falls back to nu_cmd_lang’s own crate version (env!("CARGO_PKG_VERSION")).

If you’re embedding Nushell (or wiring nu_cmd_lang into another binary), set this static before calling version so it reports your host binary’s version.

let version = env!("CARGO_PKG_VERSION")
    .parse()
    .expect("cargo sets valid version");

nu_cmd_lang::VERSION
    .set(version)
    .expect("VERSION is unset");