mirror of
https://github.com/nushell/nushell
synced 2024-12-28 05:53:09 +00:00
Return version from clap
This is what `nu --version` uses.
This commit is contained in:
parent
30187e0311
commit
bbe7d68659
1 changed files with 1 additions and 3 deletions
|
@ -5,8 +5,6 @@ use crate::parser::registry::Signature;
|
||||||
use crate::prelude::*;
|
use crate::prelude::*;
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
|
|
||||||
const VERSION: &'static str = env!("CARGO_PKG_VERSION");
|
|
||||||
|
|
||||||
pub struct Version;
|
pub struct Version;
|
||||||
|
|
||||||
impl WholeStreamCommand for Version {
|
impl WholeStreamCommand for Version {
|
||||||
|
@ -34,7 +32,7 @@ pub fn date(args: CommandArgs, registry: &CommandRegistry) -> Result<OutputStrea
|
||||||
let mut indexmap = IndexMap::new();
|
let mut indexmap = IndexMap::new();
|
||||||
indexmap.insert(
|
indexmap.insert(
|
||||||
"version".to_string(),
|
"version".to_string(),
|
||||||
Tagged::from_simple_spanned_item(Value::string(VERSION.to_string()), span),
|
Tagged::from_simple_spanned_item(Value::string(clap::crate_version!()), span),
|
||||||
);
|
);
|
||||||
|
|
||||||
let value = Tagged::from_simple_spanned_item(Value::Object(Dictionary::from(indexmap)), span);
|
let value = Tagged::from_simple_spanned_item(Value::Object(Dictionary::from(indexmap)), span);
|
||||||
|
|
Loading…
Reference in a new issue