1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 19:17:43 +00:00

replace VERSION string with clap::crate_version

replace VERSION string with clap::crate_version in chcon, chgrp and runcon
utilities

Signed-off-by: Akhil Mohan <akhilerm@gmail.com>
This commit is contained in:
Akhil Mohan 2023-03-05 19:22:50 +05:30
parent dc0092c9e7
commit cf6f9a700d
No known key found for this signature in database
GPG key ID: CE237415BA2A2E78
3 changed files with 6 additions and 9 deletions

View file

@ -5,7 +5,7 @@ use clap::builder::ValueParser;
use uucore::error::{UResult, USimpleError, UUsageError};
use uucore::{display::Quotable, format_usage, help_about, help_usage, show_error, show_warning};
use clap::{Arg, ArgAction, Command};
use clap::{crate_version, Arg, ArgAction, Command};
use selinux::{OpaqueSecurityContext, SecurityContext};
use std::borrow::Cow;
@ -19,7 +19,6 @@ mod fts;
use errors::*;
const VERSION: &str = env!("CARGO_PKG_VERSION");
const ABOUT: &str = help_about!("chcon.md");
const USAGE: &str = help_usage!("chcon.md");
@ -146,7 +145,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command {
Command::new(uucore::util_name())
.version(VERSION)
.version(crate_version!())
.about(ABOUT)
.override_usage(format_usage(USAGE))
.infer_long_args(true)

View file

@ -13,12 +13,11 @@ use uucore::error::{FromIo, UResult, USimpleError};
use uucore::perms::{chown_base, options, IfFrom};
use uucore::{format_usage, help_about, help_usage};
use clap::{Arg, ArgAction, ArgMatches, Command};
use clap::{crate_version, Arg, ArgAction, ArgMatches, Command};
use std::fs;
use std::os::unix::fs::MetadataExt;
static VERSION: &str = env!("CARGO_PKG_VERSION");
static ABOUT: &str = help_about!("chgrp.md");
const USAGE: &str = help_usage!("chgrp.md");
@ -56,7 +55,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command {
Command::new(uucore::util_name())
.version(VERSION)
.version(crate_version!())
.about(ABOUT)
.override_usage(format_usage(USAGE))
.infer_long_args(true)

View file

@ -3,7 +3,7 @@
use clap::builder::ValueParser;
use uucore::error::{UResult, UUsageError};
use clap::{Arg, ArgAction, Command};
use clap::{crate_version, Arg, ArgAction, Command};
use selinux::{OpaqueSecurityContext, SecurityClass, SecurityContext};
use uucore::format_usage;
@ -18,7 +18,6 @@ mod errors;
use errors::error_exit_status;
use errors::{Error, Result, RunconError};
const VERSION: &str = env!("CARGO_PKG_VERSION");
const ABOUT: &str = "Run command with specified security context.";
const USAGE: &str = "\
{} [CONTEXT COMMAND [ARG...]]
@ -107,7 +106,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command {
Command::new(uucore::util_name())
.version(VERSION)
.version(crate_version!())
.about(ABOUT)
.after_help(DESCRIPTION)
.override_usage(format_usage(USAGE))