feat: add RustyPipe version constant
This commit is contained in:
parent
a7fb0d641a
commit
c5e695e297
4 changed files with 12 additions and 2 deletions
|
|
@ -59,3 +59,4 @@ dirs.workspace = true
|
||||||
|
|
||||||
anstream = "0.6.15"
|
anstream = "0.6.15"
|
||||||
owo-colors = "4.0.0"
|
owo-colors = "4.0.0"
|
||||||
|
const_format = "0.2.33"
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ use std::{
|
||||||
};
|
};
|
||||||
|
|
||||||
use clap::{Parser, Subcommand, ValueEnum};
|
use clap::{Parser, Subcommand, ValueEnum};
|
||||||
|
use const_format::formatcp;
|
||||||
use futures::stream::{self, StreamExt};
|
use futures::stream::{self, StreamExt};
|
||||||
use indicatif::{MultiProgress, ProgressBar, ProgressStyle};
|
use indicatif::{MultiProgress, ProgressBar, ProgressStyle};
|
||||||
use owo_colors::OwoColorize;
|
use owo_colors::OwoColorize;
|
||||||
|
|
@ -29,7 +30,12 @@ use tracing::level_filters::LevelFilter;
|
||||||
use tracing_subscriber::{fmt::MakeWriter, EnvFilter};
|
use tracing_subscriber::{fmt::MakeWriter, EnvFilter};
|
||||||
|
|
||||||
#[derive(Parser)]
|
#[derive(Parser)]
|
||||||
#[clap(author, version, about, long_about = None)]
|
#[clap(
|
||||||
|
author,
|
||||||
|
version = formatcp!("{}\nrustypipe {}", env!("CARGO_PKG_VERSION"), rustypipe::VERSION),
|
||||||
|
about,
|
||||||
|
long_about = None
|
||||||
|
)]
|
||||||
struct Cli {
|
struct Cli {
|
||||||
#[clap(subcommand)]
|
#[clap(subcommand)]
|
||||||
command: Commands,
|
command: Commands,
|
||||||
|
|
|
||||||
|
|
@ -19,3 +19,6 @@ pub mod model;
|
||||||
pub mod param;
|
pub mod param;
|
||||||
pub mod report;
|
pub mod report;
|
||||||
pub mod validate;
|
pub mod validate;
|
||||||
|
|
||||||
|
/// Version of the RustyPipe crate
|
||||||
|
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ impl RustyPipeInfo<'_> {
|
||||||
pub(crate) fn new(language: Option<Language>) -> Self {
|
pub(crate) fn new(language: Option<Language>) -> Self {
|
||||||
Self {
|
Self {
|
||||||
package: env!("CARGO_PKG_NAME"),
|
package: env!("CARGO_PKG_NAME"),
|
||||||
version: env!("CARGO_PKG_VERSION"),
|
version: crate::VERSION,
|
||||||
date: util::now_sec(),
|
date: util::now_sec(),
|
||||||
language,
|
language,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Reference in a new issue