Offline, privacy-first grammar checker. Fast, open-source, Rust-powered
Add `core_version` to `harper-core` (#1168)
Jack Utega96403e2f342
diff --git a/harper-cli/src/main.rs b/harper-cli/src/main.rsindex c7706c04f..63da2d473 100644--- a/harper-cli/src/main.rs+++ b/harper-cli/src/main.rs@@ -76,6 +76,8 @@ enum Args {/// The document to mine words from.file: PathBuf,},+ /// Print harper-core version.+ CoreVersion,}fn main() -> anyhow::Result<()> {@@ -361,6 +363,10 @@ fn main() -> anyhow::Result<()> {Ok(())}+ Args::CoreVersion => {+ println!("harper-core v{}", harper_core::core_version());+ Ok(())+ }}}diff --git a/harper-core/src/lib.rs b/harper-core/src/lib.rsindex 739dc8296..24d1c93aa 100644--- a/harper-core/src/lib.rs+++ b/harper-core/src/lib.rs@@ -49,6 +49,11 @@ pub use word_metadata::{AdverbData, ConjunctionData, Dialect, NounData, PronounData, Tense, VerbData, WordMetadata,};+/// Return harper-core version+pub fn core_version() -> &'static str {+ env!("CARGO_PKG_VERSION")+}+/// A utility function that removes overlapping lints in a vector,/// keeping the more important ones.///