Set version for --version

This commit is contained in:
Daniel Hofstetter
2025-10-21 09:50:06 +02:00
parent 8b4a8032d0
commit 29ff1c2a9b
+2 -1
View File
@@ -3,7 +3,7 @@
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.
use clap::{arg, Arg, ArgAction, Command};
use clap::{arg, crate_version, Arg, ArgAction, Command};
use std::path::PathBuf;
use uucore::error::UResult;
use uucore::format_usage;
@@ -31,6 +31,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
#[allow(clippy::cognitive_complexity)]
pub fn uu_app() -> Command {
Command::new(uucore::util_name())
.version(crate_version!())
.about(ABOUT)
.override_usage(format_usage(USAGE))
.infer_long_args(true)