diff --git a/src/sed/mod.rs b/src/sed/mod.rs index 1206140..7868823 100644 --- a/src/sed/mod.rs +++ b/src/sed/mod.rs @@ -24,14 +24,15 @@ use crate::sed::command::{ProcessingContext, StringSpace}; use crate::sed::compiler::compile; use crate::sed::processor::process_all_files; use crate::sed::script_line_provider::ScriptValue; -use clap::{Arg, ArgMatches, Command, arg, crate_version}; +use clap::{Arg, ArgMatches, Command, arg}; use std::collections::HashMap; use std::path::PathBuf; use uucore::error::{UResult, UUsageError}; use uucore::format_usage; -const ABOUT: &str = "Stream editor for filtering and transforming text"; +const ABOUT: &str = "Stream editor for filtering and transforming text (part of uutils)"; const USAGE: &str = "sed [OPTION]... [script] [file]..."; +const VERSION: &str = concat!(env!("CARGO_PKG_VERSION"), " (uutils)"); #[uucore::main] pub fn uumain(args: impl uucore::Args) -> UResult<()> { @@ -52,7 +53,7 @@ pub fn uu_app() -> Command { let util_name = uucore::util_name(); Command::new(util_name) - .version(crate_version!()) + .version(VERSION) .about(ABOUT) .override_usage(format_usage(USAGE)) .args_override_self(true) diff --git a/tests/by-util/test_sed.rs b/tests/by-util/test_sed.rs index b31fed7..f695264 100644 --- a/tests/by-util/test_sed.rs +++ b/tests/by-util/test_sed.rs @@ -38,7 +38,18 @@ fn test_version() { .arg("--version") .succeeds() .no_stderr() - .stdout_is(short); + .stdout_is(&short); + + assert!(short.contains("uutils")); +} + +#[test] +fn test_help_mentions_uutils() { + new_ucmd!() + .arg("--help") + .succeeds() + .no_stderr() + .stdout_contains("part of uutils"); } #[test]