1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

Merge pull request #7441 from cakebaker/all_adapt_version_string

all: add `(uutils coreutils)` to version string
This commit is contained in:
Sylvestre Ledru 2025-03-15 17:35:09 +01:00 committed by GitHub
commit 0b228cfd3e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
101 changed files with 218 additions and 200 deletions

View file

@ -1,2 +1,5 @@
[target.x86_64-unknown-redox] [target.x86_64-unknown-redox]
linker = "x86_64-unknown-redox-gcc" linker = "x86_64-unknown-redox-gcc"
[env]
PROJECT_NAME_FOR_VERSION_STRING = "uutils coreutils"

View file

@ -5,7 +5,7 @@
use platform_info::*; use platform_info::*;
use clap::{crate_version, Command}; use clap::Command;
use uucore::error::{UResult, USimpleError}; use uucore::error::{UResult, USimpleError};
use uucore::{help_about, help_section}; use uucore::{help_about, help_section};
@ -24,7 +24,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.after_help(SUMMARY) .after_help(SUMMARY)
.infer_long_args(true) .infer_long_args(true)

View file

@ -5,7 +5,7 @@
// spell-checker:ignore hexupper lsbf msbf unpadded nopad aGVsbG8sIHdvcmxkIQ // spell-checker:ignore hexupper lsbf msbf unpadded nopad aGVsbG8sIHdvcmxkIQ
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use std::fs::File; use std::fs::File;
use std::io::{self, ErrorKind, Read, Seek, SeekFrom}; use std::io::{self, ErrorKind, Read, Seek, SeekFrom};
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
@ -104,7 +104,7 @@ pub fn parse_base_cmd_args(
pub fn base_app(about: &'static str, usage: &str) -> Command { pub fn base_app(about: &'static str, usage: &str) -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(about) .about(about)
.override_usage(format_usage(usage)) .override_usage(format_usage(usage))
.infer_long_args(true) .infer_long_args(true)

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (ToDO) fullname // spell-checker:ignore (ToDO) fullname
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use std::path::{is_separator, PathBuf}; use std::path::{is_separator, PathBuf};
use uucore::display::Quotable; use uucore::display::Quotable;
use uucore::error::{UResult, UUsageError}; use uucore::error::{UResult, UUsageError};
@ -76,7 +76,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -16,7 +16,7 @@ use std::os::unix::fs::FileTypeExt;
#[cfg(unix)] #[cfg(unix)]
use std::os::unix::net::UnixStream; use std::os::unix::net::UnixStream;
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
#[cfg(unix)] #[cfg(unix)]
use nix::fcntl::{fcntl, FcntlArg}; use nix::fcntl::{fcntl, FcntlArg};
use thiserror::Error; use thiserror::Error;
@ -229,7 +229,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.about(ABOUT) .about(ABOUT)
.infer_long_args(true) .infer_long_args(true)

View file

@ -9,7 +9,7 @@ use clap::builder::ValueParser;
use uucore::error::{UResult, USimpleError, UUsageError}; use uucore::error::{UResult, USimpleError, UUsageError};
use uucore::{display::Quotable, format_usage, help_about, help_usage, show_error, show_warning}; use uucore::{display::Quotable, format_usage, help_about, help_usage, show_error, show_warning};
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use selinux::{OpaqueSecurityContext, SecurityContext}; use selinux::{OpaqueSecurityContext, SecurityContext};
use std::borrow::Cow; use std::borrow::Cow;
@ -149,7 +149,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -11,7 +11,7 @@ use uucore::error::{FromIo, UResult, USimpleError};
use uucore::perms::{chown_base, options, GidUidOwnerFilter, IfFrom}; use uucore::perms::{chown_base, options, GidUidOwnerFilter, IfFrom};
use uucore::{format_usage, help_about, help_usage}; use uucore::{format_usage, help_about, help_usage};
use clap::{crate_version, Arg, ArgAction, ArgMatches, Command}; use clap::{Arg, ArgAction, ArgMatches, Command};
use std::fs; use std::fs;
use std::os::unix::fs::MetadataExt; use std::os::unix::fs::MetadataExt;
@ -98,7 +98,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (ToDO) Chmoder cmode fmode fperm fref ugoa RFILE RFILE's // spell-checker:ignore (ToDO) Chmoder cmode fmode fperm fref ugoa RFILE RFILE's
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use std::ffi::OsString; use std::ffi::OsString;
use std::fs; use std::fs;
use std::os::unix::fs::{MetadataExt, PermissionsExt}; use std::os::unix::fs::{MetadataExt, PermissionsExt};
@ -157,7 +157,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.args_override_self(true) .args_override_self(true)

View file

@ -12,7 +12,7 @@ use uucore::{format_usage, help_about, help_usage};
use uucore::error::{FromIo, UResult, USimpleError}; use uucore::error::{FromIo, UResult, USimpleError};
use clap::{crate_version, Arg, ArgAction, ArgMatches, Command}; use clap::{Arg, ArgAction, ArgMatches, Command};
use std::fs; use std::fs;
use std::os::unix::fs::MetadataExt; use std::os::unix::fs::MetadataExt;
@ -78,7 +78,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -7,7 +7,7 @@
mod error; mod error;
use crate::error::ChrootError; use crate::error::ChrootError;
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use std::ffi::CString; use std::ffi::CString;
use std::io::Error; use std::io::Error;
use std::os::unix::prelude::OsStrExt; use std::os::unix::prelude::OsStrExt;
@ -239,7 +239,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (ToDO) fname, algo // spell-checker:ignore (ToDO) fname, algo
use clap::builder::ValueParser; use clap::builder::ValueParser;
use clap::{crate_version, value_parser, Arg, ArgAction, Command}; use clap::{value_parser, Arg, ArgAction, Command};
use std::ffi::{OsStr, OsString}; use std::ffi::{OsStr, OsString};
use std::fs::File; use std::fs::File;
use std::io::{self, stdin, stdout, BufReader, Read, Write}; use std::io::{self, stdin, stdout, BufReader, Read, Write};
@ -342,7 +342,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -13,7 +13,7 @@ use uucore::fs::paths_refer_to_same_file;
use uucore::line_ending::LineEnding; use uucore::line_ending::LineEnding;
use uucore::{format_usage, help_about, help_usage}; use uucore::{format_usage, help_about, help_usage};
use clap::{crate_version, Arg, ArgAction, ArgMatches, Command}; use clap::{Arg, ArgAction, ArgMatches, Command};
const ABOUT: &str = help_about!("comm.md"); const ABOUT: &str = help_about!("comm.md");
const USAGE: &str = help_usage!("comm.md"); const USAGE: &str = help_usage!("comm.md");
@ -313,7 +313,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -20,7 +20,7 @@ use std::path::{Path, PathBuf, StripPrefixError};
#[cfg(all(unix, not(target_os = "android")))] #[cfg(all(unix, not(target_os = "android")))]
use uucore::fsxattr::copy_xattrs; use uucore::fsxattr::copy_xattrs;
use clap::{builder::ValueParser, crate_version, Arg, ArgAction, ArgMatches, Command}; use clap::{builder::ValueParser, Arg, ArgAction, ArgMatches, Command};
use filetime::FileTime; use filetime::FileTime;
use indicatif::{ProgressBar, ProgressStyle}; use indicatif::{ProgressBar, ProgressStyle};
#[cfg(unix)] #[cfg(unix)]
@ -431,7 +431,7 @@ pub fn uu_app() -> Command {
options::COPY_CONTENTS, options::COPY_CONTENTS,
]; ];
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.after_help(format!( .after_help(format!(

View file

@ -12,7 +12,7 @@ use std::{
io::{BufRead, BufWriter, Write}, io::{BufRead, BufWriter, Write},
}; };
use clap::{crate_version, Arg, ArgAction, ArgMatches, Command}; use clap::{Arg, ArgAction, ArgMatches, Command};
use regex::Regex; use regex::Regex;
use uucore::display::Quotable; use uucore::display::Quotable;
use uucore::error::{FromIo, UResult}; use uucore::error::{FromIo, UResult};
@ -597,7 +597,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.args_override_self(true) .args_override_self(true)

View file

@ -6,7 +6,7 @@
// spell-checker:ignore (ToDO) delim sourcefiles // spell-checker:ignore (ToDO) delim sourcefiles
use bstr::io::BufReadExt; use bstr::io::BufReadExt;
use clap::{builder::ValueParser, crate_version, Arg, ArgAction, ArgMatches, Command}; use clap::{builder::ValueParser, Arg, ArgAction, ArgMatches, Command};
use std::ffi::OsString; use std::ffi::OsString;
use std::fs::File; use std::fs::File;
use std::io::{stdin, stdout, BufRead, BufReader, BufWriter, IsTerminal, Read, Write}; use std::io::{stdin, stdout, BufRead, BufReader, BufWriter, IsTerminal, Read, Write};
@ -565,7 +565,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.about(ABOUT) .about(ABOUT)
.after_help(AFTER_HELP) .after_help(AFTER_HELP)

View file

@ -9,7 +9,7 @@ use chrono::format::{Item, StrftimeItems};
use chrono::{DateTime, FixedOffset, Local, Offset, TimeDelta, Utc}; use chrono::{DateTime, FixedOffset, Local, Offset, TimeDelta, Utc};
#[cfg(windows)] #[cfg(windows)]
use chrono::{Datelike, Timelike}; use chrono::{Datelike, Timelike};
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
#[cfg(all(unix, not(target_os = "macos"), not(target_os = "redox")))] #[cfg(all(unix, not(target_os = "macos"), not(target_os = "redox")))]
use libc::{clock_settime, timespec, CLOCK_REALTIME}; use libc::{clock_settime, timespec, CLOCK_REALTIME};
use std::fs::File; use std::fs::File;
@ -309,7 +309,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -45,7 +45,7 @@ use std::sync::{atomic::Ordering::Relaxed, mpsc, Arc};
use std::thread; use std::thread;
use std::time::{Duration, Instant}; use std::time::{Duration, Instant};
use clap::{crate_version, Arg, Command}; use clap::{Arg, Command};
use gcd::Gcd; use gcd::Gcd;
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
use nix::{ use nix::{
@ -1431,7 +1431,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.after_help(AFTER_HELP) .after_help(AFTER_HELP)

View file

@ -17,7 +17,7 @@ use uucore::fsext::{read_fs_list, MountInfo};
use uucore::parse_size::ParseSizeError; use uucore::parse_size::ParseSizeError;
use uucore::{format_usage, help_about, help_section, help_usage, show}; use uucore::{format_usage, help_about, help_section, help_usage, show};
use clap::{crate_version, parser::ValueSource, Arg, ArgAction, ArgMatches, Command}; use clap::{parser::ValueSource, Arg, ArgAction, ArgMatches, Command};
use std::error::Error; use std::error::Error;
use std::ffi::OsString; use std::ffi::OsString;
@ -499,7 +499,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.after_help(AFTER_HELP) .after_help(AFTER_HELP)

View file

@ -11,7 +11,7 @@ use std::fs::File;
use std::io::{BufRead, BufReader}; use std::io::{BufRead, BufReader};
use std::path::Path; use std::path::Path;
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use uucore::colors::{FILE_ATTRIBUTE_CODES, FILE_COLORS, FILE_TYPES, TERMS}; use uucore::colors::{FILE_ATTRIBUTE_CODES, FILE_COLORS, FILE_TYPES, TERMS};
use uucore::display::Quotable; use uucore::display::Quotable;
use uucore::error::{UResult, USimpleError, UUsageError}; use uucore::error::{UResult, USimpleError, UUsageError};
@ -252,7 +252,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.after_help(AFTER_HELP) .after_help(AFTER_HELP)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))

View file

@ -3,7 +3,7 @@
// For the full copyright and license information, please view the LICENSE // For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code. // file that was distributed with this source code.
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use std::path::Path; use std::path::Path;
use uucore::display::print_verbatim; use uucore::display::print_verbatim;
use uucore::error::{UResult, UUsageError}; use uucore::error::{UResult, UUsageError};
@ -62,7 +62,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.about(ABOUT) .about(ABOUT)
.version(crate_version!()) .version(uucore::crate_version!())
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.args_override_self(true) .args_override_self(true)
.infer_long_args(true) .infer_long_args(true)

View file

@ -4,7 +4,7 @@
// file that was distributed with this source code. // file that was distributed with this source code.
use chrono::{DateTime, Local}; use chrono::{DateTime, Local};
use clap::{builder::PossibleValue, crate_version, Arg, ArgAction, ArgMatches, Command}; use clap::{builder::PossibleValue, Arg, ArgAction, ArgMatches, Command};
use glob::Pattern; use glob::Pattern;
use std::collections::HashSet; use std::collections::HashSet;
use std::env; use std::env;
@ -824,7 +824,7 @@ fn parse_depth(max_depth_str: Option<&str>, summarize: bool) -> UResult<Option<u
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.after_help(AFTER_HELP) .after_help(AFTER_HELP)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))

View file

@ -4,7 +4,7 @@
// file that was distributed with this source code. // file that was distributed with this source code.
use clap::builder::ValueParser; use clap::builder::ValueParser;
use clap::{crate_version, Arg, ArgAction, ArgMatches, Command}; use clap::{Arg, ArgAction, ArgMatches, Command};
use std::env; use std::env;
use std::ffi::{OsStr, OsString}; use std::ffi::{OsStr, OsString};
use std::io::{self, StdoutLock, Write}; use std::io::{self, StdoutLock, Write};
@ -85,7 +85,7 @@ pub fn uu_app() -> Command {
// Final argument must have multiple(true) or the usage string equivalent. // Final argument must have multiple(true) or the usage string equivalent.
.trailing_var_arg(true) .trailing_var_arg(true)
.allow_hyphen_values(true) .allow_hyphen_values(true)
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.after_help(AFTER_HELP) .after_help(AFTER_HELP)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))

View file

@ -13,7 +13,7 @@ pub mod string_parser;
pub mod variable_parser; pub mod variable_parser;
use clap::builder::ValueParser; use clap::builder::ValueParser;
use clap::{crate_name, crate_version, Arg, ArgAction, Command}; use clap::{crate_name, Arg, ArgAction, Command};
use ini::Ini; use ini::Ini;
use native_int_str::{ use native_int_str::{
from_native_int_representation_owned, Convert, NCvt, NativeIntStr, NativeIntString, NativeStr, from_native_int_representation_owned, Convert, NCvt, NativeIntStr, NativeIntString, NativeStr,
@ -173,7 +173,7 @@ fn load_config_file(opts: &mut Options) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(crate_name!()) Command::new(crate_name!())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.after_help(AFTER_HELP) .after_help(AFTER_HELP)

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (ToDO) ctype cwidth iflag nbytes nspaces nums tspaces uflag Preprocess // spell-checker:ignore (ToDO) ctype cwidth iflag nbytes nspaces nums tspaces uflag Preprocess
use clap::{crate_version, Arg, ArgAction, ArgMatches, Command}; use clap::{Arg, ArgAction, ArgMatches, Command};
use std::error::Error; use std::error::Error;
use std::ffi::OsString; use std::ffi::OsString;
use std::fmt; use std::fmt;
@ -272,7 +272,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.after_help(LONG_HELP) .after_help(LONG_HELP)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))

View file

@ -3,7 +3,7 @@
// For the full copyright and license information, please view the LICENSE // For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code. // file that was distributed with this source code.
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use syntax_tree::{is_truthy, AstNode}; use syntax_tree::{is_truthy, AstNode};
use thiserror::Error; use thiserror::Error;
use uucore::{ use uucore::{
@ -64,7 +64,7 @@ impl UError for ExprError {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(help_about!("expr.md")) .about(help_about!("expr.md"))
.override_usage(format_usage(help_usage!("expr.md"))) .override_usage(format_usage(help_usage!("expr.md")))
.after_help(help_section!("after help", "expr.md")) .after_help(help_section!("after help", "expr.md"))
@ -102,7 +102,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
if args.len() == 1 && args[0] == "--help" { if args.len() == 1 && args[0] == "--help" {
let _ = uu_app().print_help(); let _ = uu_app().print_help();
} else if args.len() == 1 && args[0] == "--version" { } else if args.len() == 1 && args[0] == "--version" {
println!("{} {}", uucore::util_name(), crate_version!()) println!("{} {}", uucore::util_name(), uucore::crate_version!())
} else { } else {
// The first argument may be "--" and should be be ignored. // The first argument may be "--" and should be be ignored.
let args = if !args.is_empty() && args[0] == "--" { let args = if !args.is_empty() && args[0] == "--" {

View file

@ -9,7 +9,7 @@ use std::collections::BTreeMap;
use std::io::BufRead; use std::io::BufRead;
use std::io::{self, stdin, stdout, Write}; use std::io::{self, stdin, stdout, Write};
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use num_bigint::BigUint; use num_bigint::BigUint;
use num_traits::FromPrimitive; use num_traits::FromPrimitive;
use uucore::display::Quotable; use uucore::display::Quotable;
@ -121,7 +121,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -45,7 +45,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(clap::crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
// We provide our own help and version options, to ensure maximum compatibility with GNU. // We provide our own help and version options, to ensure maximum compatibility with GNU.
.disable_help_flag(true) .disable_help_flag(true)

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (ToDO) PSKIP linebreak ostream parasplit tabwidth xanti xprefix // spell-checker:ignore (ToDO) PSKIP linebreak ostream parasplit tabwidth xanti xprefix
use clap::{crate_version, Arg, ArgAction, ArgMatches, Command}; use clap::{Arg, ArgAction, ArgMatches, Command};
use std::fs::File; use std::fs::File;
use std::io::{stdin, stdout, BufReader, BufWriter, Read, Stdout, Write}; use std::io::{stdin, stdout, BufReader, BufWriter, Read, Stdout, Write};
use uucore::display::Quotable; use uucore::display::Quotable;
@ -329,7 +329,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (ToDOs) ncount routput // spell-checker:ignore (ToDOs) ncount routput
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use std::fs::File; use std::fs::File;
use std::io::{stdin, BufRead, BufReader, Read}; use std::io::{stdin, BufRead, BufReader, Read};
use std::path::Path; use std::path::Path;
@ -59,7 +59,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.about(ABOUT) .about(ABOUT)
.infer_long_args(true) .infer_long_args(true)

View file

@ -13,7 +13,7 @@ use uucore::{
format_usage, help_about, help_usage, show, format_usage, help_about, help_usage, show,
}; };
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
mod options { mod options {
pub const USERS: &str = "USERNAME"; pub const USERS: &str = "USERNAME";
@ -82,7 +82,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -6,7 +6,6 @@
// spell-checker:ignore (ToDO) algo, algoname, regexes, nread, nonames // spell-checker:ignore (ToDO) algo, algoname, regexes, nread, nonames
use clap::builder::ValueParser; use clap::builder::ValueParser;
use clap::crate_version;
use clap::value_parser; use clap::value_parser;
use clap::ArgAction; use clap::ArgAction;
use clap::{Arg, ArgMatches, Command}; use clap::{Arg, ArgMatches, Command};
@ -318,7 +317,7 @@ pub fn uu_app_common() -> Command {
#[cfg(not(windows))] #[cfg(not(windows))]
const TEXT_HELP: &str = "read in text mode (default)"; const TEXT_HELP: &str = "read in text mode (default)";
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (vars) seekable // spell-checker:ignore (vars) seekable
use clap::{crate_version, Arg, ArgAction, ArgMatches, Command}; use clap::{Arg, ArgAction, ArgMatches, Command};
use std::ffi::OsString; use std::ffi::OsString;
#[cfg(unix)] #[cfg(unix)]
use std::fs::File; use std::fs::File;
@ -72,7 +72,7 @@ type HeadResult<T> = Result<T, HeadError>;
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (ToDO) gethostid // spell-checker:ignore (ToDO) gethostid
use clap::{crate_version, Command}; use clap::Command;
use libc::c_long; use libc::c_long;
use uucore::{error::UResult, format_usage, help_about, help_usage}; use uucore::{error::UResult, format_usage, help_about, help_usage};
@ -26,7 +26,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -11,7 +11,7 @@ use std::str;
use std::{collections::hash_set::HashSet, ffi::OsString}; use std::{collections::hash_set::HashSet, ffi::OsString};
use clap::builder::ValueParser; use clap::builder::ValueParser;
use clap::{crate_version, Arg, ArgAction, ArgMatches, Command}; use clap::{Arg, ArgAction, ArgMatches, Command};
#[cfg(any(target_os = "freebsd", target_os = "openbsd"))] #[cfg(any(target_os = "freebsd", target_os = "openbsd"))]
use dns_lookup::lookup_host; use dns_lookup::lookup_host;
@ -75,7 +75,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -33,7 +33,7 @@
#![allow(non_camel_case_types)] #![allow(non_camel_case_types)]
#![allow(dead_code)] #![allow(dead_code)]
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use std::ffi::CStr; use std::ffi::CStr;
use uucore::display::Quotable; use uucore::display::Quotable;
use uucore::entries::{self, Group, Locate, Passwd}; use uucore::entries::{self, Group, Locate, Passwd};
@ -320,7 +320,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -7,7 +7,7 @@
mod mode; mod mode;
use clap::{crate_version, Arg, ArgAction, ArgMatches, Command}; use clap::{Arg, ArgAction, ArgMatches, Command};
use file_diff::diff; use file_diff::diff;
use filetime::{set_file_times, FileTime}; use filetime::{set_file_times, FileTime};
use std::error::Error; use std::error::Error;
@ -194,7 +194,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -6,7 +6,7 @@
// spell-checker:ignore (ToDO) autoformat FILENUM whitespaces pairable unpairable nocheck memmem // spell-checker:ignore (ToDO) autoformat FILENUM whitespaces pairable unpairable nocheck memmem
use clap::builder::ValueParser; use clap::builder::ValueParser;
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use memchr::{memchr_iter, memmem::Finder, Memchr3}; use memchr::{memchr_iter, memmem::Finder, Memchr3};
use std::cmp::Ordering; use std::cmp::Ordering;
use std::error::Error; use std::error::Error;
@ -871,7 +871,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (ToDO) signalname pids killpg // spell-checker:ignore (ToDO) signalname pids killpg
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use nix::sys::signal::{self, Signal}; use nix::sys::signal::{self, Signal};
use nix::unistd::Pid; use nix::unistd::Pid;
use std::io::Error; use std::io::Error;
@ -103,7 +103,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -3,7 +3,7 @@
// For the full copyright and license information, please view the LICENSE // For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code. // file that was distributed with this source code.
use clap::builder::ValueParser; use clap::builder::ValueParser;
use clap::{crate_version, Arg, Command}; use clap::{Arg, Command};
use std::ffi::OsString; use std::ffi::OsString;
use std::fs::hard_link; use std::fs::hard_link;
use std::path::Path; use std::path::Path;
@ -35,7 +35,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (ToDO) srcpath targetpath EEXIST // spell-checker:ignore (ToDO) srcpath targetpath EEXIST
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use uucore::display::Quotable; use uucore::display::Quotable;
use uucore::error::{FromIo, UError, UResult}; use uucore::error::{FromIo, UError, UResult};
use uucore::fs::{make_path_relative_to, paths_refer_to_same_file}; use uucore::fs::{make_path_relative_to, paths_refer_to_same_file};
@ -158,7 +158,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (ToDO) getlogin userlogin // spell-checker:ignore (ToDO) getlogin userlogin
use clap::{crate_version, Command}; use clap::Command;
use std::ffi::CStr; use std::ffi::CStr;
use uucore::{error::UResult, format_usage, help_about, help_usage, show_error}; use uucore::{error::UResult, format_usage, help_about, help_usage, show_error};
@ -42,7 +42,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.about(ABOUT) .about(ABOUT)
.infer_long_args(true) .infer_long_args(true)

View file

@ -30,7 +30,7 @@ use ansi_width::ansi_width;
use chrono::{DateTime, Local, TimeDelta}; use chrono::{DateTime, Local, TimeDelta};
use clap::{ use clap::{
builder::{NonEmptyStringValueParser, PossibleValue, ValueParser}, builder::{NonEmptyStringValueParser, PossibleValue, ValueParser},
crate_version, Arg, ArgAction, Command, Arg, ArgAction, Command,
}; };
use glob::{MatchOptions, Pattern}; use glob::{MatchOptions, Pattern};
use lscolors::LsColors; use lscolors::LsColors;
@ -1227,7 +1227,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.about(ABOUT) .about(ABOUT)
.infer_long_args(true) .infer_long_args(true)

View file

@ -7,7 +7,7 @@
use clap::builder::ValueParser; use clap::builder::ValueParser;
use clap::parser::ValuesRef; use clap::parser::ValuesRef;
use clap::{crate_version, Arg, ArgAction, ArgMatches, Command}; use clap::{Arg, ArgAction, ArgMatches, Command};
use std::ffi::OsString; use std::ffi::OsString;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
#[cfg(not(windows))] #[cfg(not(windows))]
@ -99,7 +99,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -3,7 +3,7 @@
// For the full copyright and license information, please view the LICENSE // For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code. // file that was distributed with this source code.
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use libc::mkfifo; use libc::mkfifo;
use std::ffi::CString; use std::ffi::CString;
use std::fs; use std::fs;
@ -74,7 +74,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.about(ABOUT) .about(ABOUT)
.infer_long_args(true) .infer_long_args(true)

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (ToDO) parsemode makedev sysmacros perror IFBLK IFCHR IFIFO // spell-checker:ignore (ToDO) parsemode makedev sysmacros perror IFBLK IFCHR IFIFO
use clap::{crate_version, value_parser, Arg, ArgMatches, Command}; use clap::{value_parser, Arg, ArgMatches, Command};
use libc::{dev_t, mode_t}; use libc::{dev_t, mode_t};
use libc::{S_IFBLK, S_IFCHR, S_IFIFO, S_IRGRP, S_IROTH, S_IRUSR, S_IWGRP, S_IWOTH, S_IWUSR}; use libc::{S_IFBLK, S_IFCHR, S_IFIFO, S_IRGRP, S_IROTH, S_IRUSR, S_IWGRP, S_IWOTH, S_IWUSR};
use std::ffi::CString; use std::ffi::CString;
@ -118,7 +118,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.after_help(AFTER_HELP) .after_help(AFTER_HELP)
.about(ABOUT) .about(ABOUT)

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (paths) GPGHome findxs // spell-checker:ignore (paths) GPGHome findxs
use clap::{builder::ValueParser, crate_version, Arg, ArgAction, ArgMatches, Command}; use clap::{builder::ValueParser, Arg, ArgAction, ArgMatches, Command};
use uucore::display::{println_verbatim, Quotable}; use uucore::display::{println_verbatim, Quotable};
use uucore::error::{FromIo, UError, UResult, UUsageError}; use uucore::error::{FromIo, UError, UResult, UUsageError};
use uucore::{format_usage, help_about, help_usage}; use uucore::{format_usage, help_about, help_usage};
@ -346,7 +346,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -11,7 +11,7 @@ use std::{
time::Duration, time::Duration,
}; };
use clap::{crate_version, value_parser, Arg, ArgAction, ArgMatches, Command}; use clap::{value_parser, Arg, ArgAction, ArgMatches, Command};
use crossterm::event::KeyEventKind; use crossterm::event::KeyEventKind;
use crossterm::{ use crossterm::{
cursor::{MoveTo, MoveUp}, cursor::{MoveTo, MoveUp},
@ -170,7 +170,7 @@ pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.version(crate_version!()) .version(uucore::crate_version!())
.infer_long_args(true) .infer_long_args(true)
.arg( .arg(
Arg::new(options::PRINT_OVER) Arg::new(options::PRINT_OVER)

View file

@ -8,7 +8,7 @@
mod error; mod error;
use clap::builder::ValueParser; use clap::builder::ValueParser;
use clap::{crate_version, error::ErrorKind, Arg, ArgAction, ArgMatches, Command}; use clap::{error::ErrorKind, Arg, ArgAction, ArgMatches, Command};
use indicatif::{MultiProgress, ProgressBar, ProgressStyle}; use indicatif::{MultiProgress, ProgressBar, ProgressStyle};
use std::collections::HashSet; use std::collections::HashSet;
use std::env; use std::env;
@ -180,7 +180,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.after_help(format!( .after_help(format!(

View file

@ -10,7 +10,7 @@ use std::ffi::{CString, OsString};
use std::io::{Error, Write}; use std::io::{Error, Write};
use std::ptr; use std::ptr;
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use uucore::{ use uucore::{
error::{set_exit_code, UClapError, UResult, USimpleError, UUsageError}, error::{set_exit_code, UClapError, UResult, USimpleError, UUsageError},
format_usage, help_about, help_usage, show_error, format_usage, help_about, help_usage, show_error,
@ -191,7 +191,7 @@ pub fn uu_app() -> Command {
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.trailing_var_arg(true) .trailing_var_arg(true)
.infer_long_args(true) .infer_long_args(true)
.version(crate_version!()) .version(uucore::crate_version!())
.arg( .arg(
Arg::new(options::ADJUSTMENT) Arg::new(options::ADJUSTMENT)
.short('n') .short('n')

View file

@ -3,7 +3,7 @@
// For the full copyright and license information, please view the LICENSE // For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code. // file that was distributed with this source code.
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use std::fs::File; use std::fs::File;
use std::io::{stdin, BufRead, BufReader, Read}; use std::io::{stdin, BufRead, BufReader, Read};
use std::path::Path; use std::path::Path;
@ -223,7 +223,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.about(ABOUT) .about(ABOUT)
.version(crate_version!()) .version(uucore::crate_version!())
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.after_help(AFTER_HELP) .after_help(AFTER_HELP)
.infer_long_args(true) .infer_long_args(true)

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (ToDO) execvp SIGHUP cproc vprocmgr cstrs homeout // spell-checker:ignore (ToDO) execvp SIGHUP cproc vprocmgr cstrs homeout
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use libc::{c_char, dup2, execvp, signal}; use libc::{c_char, dup2, execvp, signal};
use libc::{SIGHUP, SIG_IGN}; use libc::{SIGHUP, SIG_IGN};
use std::env; use std::env;
@ -91,7 +91,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.after_help(AFTER_HELP) .after_help(AFTER_HELP)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (ToDO) NPROCESSORS nprocs numstr threadstr sysconf // spell-checker:ignore (ToDO) NPROCESSORS nprocs numstr threadstr sysconf
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use std::{env, thread}; use std::{env, thread};
use uucore::display::Quotable; use uucore::display::Quotable;
use uucore::error::{UResult, USimpleError}; use uucore::error::{UResult, USimpleError};
@ -94,7 +94,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -7,7 +7,7 @@ use crate::errors::*;
use crate::format::format_and_print; use crate::format::format_and_print;
use crate::options::*; use crate::options::*;
use crate::units::{Result, Unit}; use crate::units::{Result, Unit};
use clap::{crate_version, parser::ValueSource, Arg, ArgAction, ArgMatches, Command}; use clap::{parser::ValueSource, Arg, ArgAction, ArgMatches, Command};
use std::io::{BufRead, Write}; use std::io::{BufRead, Write};
use std::str::FromStr; use std::str::FromStr;
@ -256,7 +256,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.after_help(AFTER_HELP) .after_help(AFTER_HELP)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))

View file

@ -40,7 +40,7 @@ use crate::partialreader::PartialReader;
use crate::peekreader::{PeekRead, PeekReader}; use crate::peekreader::{PeekRead, PeekReader};
use crate::prn_char::format_ascii_dump; use crate::prn_char::format_ascii_dump;
use clap::ArgAction; use clap::ArgAction;
use clap::{crate_version, parser::ValueSource, Arg, ArgMatches, Command}; use clap::{parser::ValueSource, Arg, ArgMatches, Command};
use uucore::display::Quotable; use uucore::display::Quotable;
use uucore::error::{UResult, USimpleError}; use uucore::error::{UResult, USimpleError};
use uucore::parse_size::ParseSizeError; use uucore::parse_size::ParseSizeError;
@ -251,7 +251,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.after_help(AFTER_HELP) .after_help(AFTER_HELP)

View file

@ -3,7 +3,7 @@
// For the full copyright and license information, please view the LICENSE // For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code. // file that was distributed with this source code.
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use std::cell::{OnceCell, RefCell}; use std::cell::{OnceCell, RefCell};
use std::fs::File; use std::fs::File;
use std::io::{stdin, stdout, BufRead, BufReader, Stdin, Write}; use std::io::{stdin, stdout, BufRead, BufReader, Stdin, Write};
@ -42,7 +42,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -5,7 +5,7 @@
#![allow(unused_must_use)] // because we of writeln! #![allow(unused_must_use)] // because we of writeln!
// spell-checker:ignore (ToDO) lstat // spell-checker:ignore (ToDO) lstat
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use std::fs; use std::fs;
use std::io::{ErrorKind, Write}; use std::io::{ErrorKind, Write};
use uucore::display::Quotable; use uucore::display::Quotable;
@ -79,7 +79,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (ToDO) BUFSIZE gecos fullname, mesg iobuf // spell-checker:ignore (ToDO) BUFSIZE gecos fullname, mesg iobuf
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use uucore::{format_usage, help_about, help_usage}; use uucore::{format_usage, help_about, help_usage};
mod platform; mod platform;
@ -32,7 +32,7 @@ use platform::uumain;
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -7,7 +7,7 @@
// spell-checker:ignore (ToDO) adFfmprt, kmerge // spell-checker:ignore (ToDO) adFfmprt, kmerge
use chrono::{DateTime, Local}; use chrono::{DateTime, Local};
use clap::{crate_version, Arg, ArgAction, ArgMatches, Command}; use clap::{Arg, ArgAction, ArgMatches, Command};
use itertools::Itertools; use itertools::Itertools;
use quick_error::ResultExt; use quick_error::ResultExt;
use regex::Regex; use regex::Regex;
@ -167,7 +167,7 @@ quick_error! {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.after_help(AFTER_HELP) .after_help(AFTER_HELP)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))

View file

@ -3,7 +3,7 @@
// For the full copyright and license information, please view the LICENSE // For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code. // file that was distributed with this source code.
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use std::env; use std::env;
use uucore::{error::UResult, format_usage, help_about, help_usage}; use uucore::{error::UResult, format_usage, help_about, help_usage};
@ -59,7 +59,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -2,7 +2,7 @@
// //
// For the full copyright and license information, please view the LICENSE // For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code. // file that was distributed with this source code.
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use std::io::stdout; use std::io::stdout;
use std::ops::ControlFlow; use std::ops::ControlFlow;
use uucore::error::{UResult, UUsageError}; use uucore::error::{UResult, UUsageError};
@ -73,7 +73,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.allow_hyphen_values(true) .allow_hyphen_values(true)
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.after_help(AFTER_HELP) .after_help(AFTER_HELP)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (ToDOs) corasick memchr Roff trunc oset iset CHARCLASS // spell-checker:ignore (ToDOs) corasick memchr Roff trunc oset iset CHARCLASS
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use regex::Regex; use regex::Regex;
use std::cmp; use std::cmp;
use std::collections::{BTreeSet, HashMap, HashSet}; use std::collections::{BTreeSet, HashMap, HashSet};
@ -736,7 +736,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.about(ABOUT) .about(ABOUT)
.version(crate_version!()) .version(uucore::crate_version!())
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)
.arg( .arg(

View file

@ -4,7 +4,7 @@
// file that was distributed with this source code. // file that was distributed with this source code.
use clap::ArgAction; use clap::ArgAction;
use clap::{crate_version, Arg, Command}; use clap::{Arg, Command};
use std::env; use std::env;
use std::io; use std::io;
use std::path::PathBuf; use std::path::PathBuf;
@ -140,7 +140,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (ToDO) errno // spell-checker:ignore (ToDO) errno
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use std::fs; use std::fs;
use std::io::{stdout, Write}; use std::io::{stdout, Write};
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
@ -101,7 +101,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -5,9 +5,7 @@
// spell-checker:ignore (ToDO) retcode // spell-checker:ignore (ToDO) retcode
use clap::{ use clap::{builder::NonEmptyStringValueParser, Arg, ArgAction, ArgMatches, Command};
builder::NonEmptyStringValueParser, crate_version, Arg, ArgAction, ArgMatches, Command,
};
use std::{ use std::{
io::{stdout, Write}, io::{stdout, Write},
path::{Path, PathBuf}, path::{Path, PathBuf},
@ -90,7 +88,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (path) eacces inacc rm-r4 // spell-checker:ignore (path) eacces inacc rm-r4
use clap::{builder::ValueParser, crate_version, parser::ValueSource, Arg, ArgAction, Command}; use clap::{builder::ValueParser, parser::ValueSource, Arg, ArgAction, Command};
use std::ffi::{OsStr, OsString}; use std::ffi::{OsStr, OsString};
use std::fs::{self, Metadata}; use std::fs::{self, Metadata};
use std::ops::BitOr; use std::ops::BitOr;
@ -175,7 +175,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -6,7 +6,7 @@
// spell-checker:ignore (ToDO) ENOTDIR // spell-checker:ignore (ToDO) ENOTDIR
use clap::builder::ValueParser; use clap::builder::ValueParser;
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use std::ffi::OsString; use std::ffi::OsString;
use std::fs::{read_dir, remove_dir}; use std::fs::{read_dir, remove_dir};
use std::io; use std::io;
@ -164,7 +164,7 @@ struct Opts {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -7,7 +7,7 @@
use clap::builder::ValueParser; use clap::builder::ValueParser;
use uucore::error::{UClapError, UError, UResult}; use uucore::error::{UClapError, UError, UResult};
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use selinux::{OpaqueSecurityContext, SecurityClass, SecurityContext}; use selinux::{OpaqueSecurityContext, SecurityClass, SecurityContext};
use uucore::{format_usage, help_about, help_section, help_usage}; use uucore::{format_usage, help_about, help_section, help_usage};
@ -88,7 +88,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.after_help(DESCRIPTION) .after_help(DESCRIPTION)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))

View file

@ -6,7 +6,7 @@
use std::ffi::OsString; use std::ffi::OsString;
use std::io::{stdout, ErrorKind, Write}; use std::io::{stdout, ErrorKind, Write};
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use num_traits::{ToPrimitive, Zero}; use num_traits::{ToPrimitive, Zero};
use uucore::error::{FromIo, UResult}; use uucore::error::{FromIo, UResult};
@ -174,7 +174,7 @@ pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.trailing_var_arg(true) .trailing_var_arg(true)
.infer_long_args(true) .infer_long_args(true)
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.arg( .arg(

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (words) wipesync prefill // spell-checker:ignore (words) wipesync prefill
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
#[cfg(unix)] #[cfg(unix)]
use libc::S_IWUSR; use libc::S_IWUSR;
use rand::{rngs::StdRng, seq::SliceRandom, Rng, SeedableRng}; use rand::{rngs::StdRng, seq::SliceRandom, Rng, SeedableRng};
@ -279,7 +279,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.after_help(AFTER_HELP) .after_help(AFTER_HELP)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (ToDO) cmdline evec nonrepeating seps shufable rvec fdata // spell-checker:ignore (ToDO) cmdline evec nonrepeating seps shufable rvec fdata
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use memchr::memchr_iter; use memchr::memchr_iter;
use rand::prelude::{IndexedRandom, SliceRandom}; use rand::prelude::{IndexedRandom, SliceRandom};
use rand::{Rng, RngCore}; use rand::{Rng, RngCore};
@ -137,7 +137,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.about(ABOUT) .about(ABOUT)
.version(crate_version!()) .version(uucore::crate_version!())
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)
.arg( .arg(

View file

@ -11,7 +11,7 @@ use uucore::{
format_usage, help_about, help_section, help_usage, show_error, format_usage, help_about, help_section, help_usage, show_error,
}; };
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use fundu::{DurationParser, ParseError, SaturatingInto}; use fundu::{DurationParser, ParseError, SaturatingInto};
static ABOUT: &str = help_about!("sleep.md"); static ABOUT: &str = help_about!("sleep.md");
@ -45,7 +45,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.after_help(AFTER_HELP) .after_help(AFTER_HELP)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))

View file

@ -19,7 +19,7 @@ mod tmp_dir;
use chunks::LineData; use chunks::LineData;
use clap::builder::ValueParser; use clap::builder::ValueParser;
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use custom_str_cmp::custom_str_cmp; use custom_str_cmp::custom_str_cmp;
use ext_sort::ext_sort; use ext_sort::ext_sort;
use fnv::FnvHasher; use fnv::FnvHasher;
@ -1278,7 +1278,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.after_help(AFTER_HELP) .after_help(AFTER_HELP)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))

View file

@ -12,7 +12,7 @@ mod strategy;
use crate::filenames::{FilenameIterator, Suffix, SuffixError}; use crate::filenames::{FilenameIterator, Suffix, SuffixError};
use crate::strategy::{NumberType, Strategy, StrategyError}; use crate::strategy::{NumberType, Strategy, StrategyError};
use clap::{crate_version, parser::ValueSource, Arg, ArgAction, ArgMatches, Command, ValueHint}; use clap::{parser::ValueSource, Arg, ArgAction, ArgMatches, Command, ValueHint};
use std::env; use std::env;
use std::ffi::OsString; use std::ffi::OsString;
use std::fmt; use std::fmt;
@ -228,7 +228,7 @@ fn handle_preceding_options(
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.after_help(AFTER_HELP) .after_help(AFTER_HELP)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))

View file

@ -18,7 +18,7 @@ use uucore::{
}; };
use chrono::{DateTime, Local}; use chrono::{DateTime, Local};
use clap::{crate_version, Arg, ArgAction, ArgMatches, Command}; use clap::{Arg, ArgAction, ArgMatches, Command};
use std::borrow::Cow; use std::borrow::Cow;
use std::ffi::{OsStr, OsString}; use std::ffi::{OsStr, OsString};
use std::fs::{FileType, Metadata}; use std::fs::{FileType, Metadata};
@ -1132,7 +1132,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (ToDO) tempdir dyld dylib optgrps libstdbuf // spell-checker:ignore (ToDO) tempdir dyld dylib optgrps libstdbuf
use clap::{crate_version, Arg, ArgAction, ArgMatches, Command}; use clap::{Arg, ArgAction, ArgMatches, Command};
use std::fs::File; use std::fs::File;
use std::io::Write; use std::io::Write;
use std::os::unix::process::ExitStatusExt; use std::os::unix::process::ExitStatusExt;
@ -193,7 +193,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.after_help(LONG_HELP) .after_help(LONG_HELP)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))

View file

@ -7,7 +7,7 @@
mod flags; mod flags;
use clap::{crate_version, Arg, ArgAction, ArgMatches, Command}; use clap::{Arg, ArgAction, ArgMatches, Command};
use nix::libc::{c_ushort, O_NONBLOCK, TIOCGWINSZ, TIOCSWINSZ}; use nix::libc::{c_ushort, O_NONBLOCK, TIOCGWINSZ, TIOCSWINSZ};
use nix::sys::termios::{ use nix::sys::termios::{
cfgetospeed, cfsetospeed, tcgetattr, tcsetattr, ControlFlags, InputFlags, LocalFlags, cfgetospeed, cfsetospeed, tcgetattr, tcsetattr, ControlFlags, InputFlags, LocalFlags,
@ -463,7 +463,7 @@ fn apply_baud_rate_flag(termios: &mut Termios, input: &str) -> ControlFlow<bool>
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.about(SUMMARY) .about(SUMMARY)
.infer_long_args(true) .infer_long_args(true)

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (ToDO) sysv // spell-checker:ignore (ToDO) sysv
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use std::fs::File; use std::fs::File;
use std::io::{stdin, Read}; use std::io::{stdin, Read};
use std::path::Path; use std::path::Path;
@ -132,7 +132,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.about(ABOUT) .about(ABOUT)
.infer_long_args(true) .infer_long_args(true)

View file

@ -5,7 +5,7 @@
/* Last synced with: sync (GNU coreutils) 8.13 */ /* Last synced with: sync (GNU coreutils) 8.13 */
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
#[cfg(any(target_os = "linux", target_os = "android"))] #[cfg(any(target_os = "linux", target_os = "android"))]
use nix::errno::Errno; use nix::errno::Errno;
#[cfg(any(target_os = "linux", target_os = "android"))] #[cfg(any(target_os = "linux", target_os = "android"))]
@ -229,7 +229,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -6,7 +6,7 @@
// spell-checker:ignore (ToDO) sbytes slen dlen memmem memmap Mmap mmap SIGBUS // spell-checker:ignore (ToDO) sbytes slen dlen memmem memmap Mmap mmap SIGBUS
mod error; mod error;
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use memchr::memmem; use memchr::memmem;
use memmap2::Mmap; use memmap2::Mmap;
use std::io::{stdin, stdout, BufWriter, Read, Write}; use std::io::{stdin, stdout, BufWriter, Read, Write};
@ -57,7 +57,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.about(ABOUT) .about(ABOUT)
.infer_long_args(true) .infer_long_args(true)

View file

@ -7,8 +7,7 @@
use crate::paths::Input; use crate::paths::Input;
use crate::{parse, platform, Quotable}; use crate::{parse, platform, Quotable};
use clap::{crate_version, value_parser}; use clap::{value_parser, Arg, ArgAction, ArgMatches, Command};
use clap::{Arg, ArgAction, ArgMatches, Command};
use fundu::{DurationParser, SaturatingInto}; use fundu::{DurationParser, SaturatingInto};
use same_file::Handle; use same_file::Handle;
use std::ffi::OsString; use std::ffi::OsString;
@ -476,7 +475,7 @@ pub fn uu_app() -> Command {
const POLLING_HELP: &str = "Disable 'ReadDirectoryChanges' support and use polling instead"; const POLLING_HELP: &str = "Disable 'ReadDirectoryChanges' support and use polling instead";
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -5,7 +5,7 @@
// cSpell:ignore POLLERR POLLRDBAND pfds revents // cSpell:ignore POLLERR POLLRDBAND pfds revents
use clap::{builder::PossibleValue, crate_version, Arg, ArgAction, Command}; use clap::{builder::PossibleValue, Arg, ArgAction, Command};
use std::fs::OpenOptions; use std::fs::OpenOptions;
use std::io::{copy, stdin, stdout, Error, ErrorKind, Read, Result, Write}; use std::io::{copy, stdin, stdout, Error, ErrorKind, Read, Result, Write};
use std::path::PathBuf; use std::path::PathBuf;
@ -99,7 +99,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.after_help(AFTER_HELP) .after_help(AFTER_HELP)

View file

@ -8,7 +8,7 @@
pub(crate) mod error; pub(crate) mod error;
mod parser; mod parser;
use clap::{crate_version, Command}; use clap::Command;
use error::{ParseError, ParseResult}; use error::{ParseError, ParseResult};
use parser::{parse, Operator, Symbol, UnaryOperator}; use parser::{parse, Operator, Symbol, UnaryOperator};
use std::ffi::{OsStr, OsString}; use std::ffi::{OsStr, OsString};
@ -42,7 +42,7 @@ pub fn uu_app() -> Command {
// Disable printing of -h and -v as valid alternatives for --help and --version, // Disable printing of -h and -v as valid alternatives for --help and --version,
// since we don't recognize -h and -v as help/version flags. // since we don't recognize -h and -v as help/version flags.
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.after_help(AFTER_HELP) .after_help(AFTER_HELP)

View file

@ -7,7 +7,7 @@
mod status; mod status;
use crate::status::ExitStatus; use crate::status::ExitStatus;
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use std::io::ErrorKind; use std::io::ErrorKind;
use std::os::unix::process::ExitStatusExt; use std::os::unix::process::ExitStatusExt;
use std::process::{self, Child, Stdio}; use std::process::{self, Child, Stdio};
@ -123,7 +123,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new("timeout") Command::new("timeout")
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.arg( .arg(

View file

@ -13,7 +13,7 @@ use chrono::{
TimeZone, Timelike, TimeZone, Timelike,
}; };
use clap::builder::{PossibleValue, ValueParser}; use clap::builder::{PossibleValue, ValueParser};
use clap::{crate_version, Arg, ArgAction, ArgGroup, ArgMatches, Command}; use clap::{Arg, ArgAction, ArgGroup, ArgMatches, Command};
use filetime::{set_file_times, set_symlink_file_times, FileTime}; use filetime::{set_file_times, set_symlink_file_times, FileTime};
use std::borrow::Cow; use std::borrow::Cow;
use std::ffi::OsString; use std::ffi::OsString;
@ -257,7 +257,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -9,7 +9,7 @@ mod operation;
mod unicode_table; mod unicode_table;
use crate::operation::DeleteOperation; use crate::operation::DeleteOperation;
use clap::{crate_version, value_parser, Arg, ArgAction, Command}; use clap::{value_parser, Arg, ArgAction, Command};
use operation::{ use operation::{
translate_input, Sequence, SqueezeOperation, SymbolTranslator, TranslateOperation, translate_input, Sequence, SqueezeOperation, SymbolTranslator, TranslateOperation,
}; };
@ -160,7 +160,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -42,7 +42,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(clap::crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
// We provide our own help and version options, to ensure maximum compatibility with GNU. // We provide our own help and version options, to ensure maximum compatibility with GNU.
.disable_help_flag(true) .disable_help_flag(true)

View file

@ -4,7 +4,7 @@
// file that was distributed with this source code. // file that was distributed with this source code.
// spell-checker:ignore (ToDO) RFILE refsize rfilename fsize tsize // spell-checker:ignore (ToDO) RFILE refsize rfilename fsize tsize
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use std::fs::{metadata, OpenOptions}; use std::fs::{metadata, OpenOptions};
use std::io::ErrorKind; use std::io::ErrorKind;
#[cfg(unix)] #[cfg(unix)]
@ -116,7 +116,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -3,7 +3,7 @@
// For the full copyright and license information, please view the LICENSE // For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code. // file that was distributed with this source code.
//spell-checker:ignore TAOCP indegree //spell-checker:ignore TAOCP indegree
use clap::{crate_version, Arg, Command}; use clap::{Arg, Command};
use std::collections::{HashMap, HashSet, VecDeque}; use std::collections::{HashMap, HashSet, VecDeque};
use std::path::Path; use std::path::Path;
use thiserror::Error; use thiserror::Error;
@ -75,7 +75,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
} }
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.about(ABOUT) .about(ABOUT)
.infer_long_args(true) .infer_long_args(true)

View file

@ -7,7 +7,7 @@
// spell-checker:ignore (ToDO) ttyname filedesc // spell-checker:ignore (ToDO) ttyname filedesc
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use std::io::{IsTerminal, Write}; use std::io::{IsTerminal, Write};
use uucore::error::{set_exit_code, UResult}; use uucore::error::{set_exit_code, UResult};
use uucore::{format_usage, help_about, help_usage}; use uucore::{format_usage, help_about, help_usage};
@ -57,7 +57,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (API) nodename osname sysname (options) mnrsv mnrsvo // spell-checker:ignore (API) nodename osname sysname (options) mnrsv mnrsvo
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use platform_info::*; use platform_info::*;
use uucore::{ use uucore::{
error::{UResult, USimpleError}, error::{UResult, USimpleError},
@ -145,7 +145,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (ToDO) nums aflag uflag scol prevtab amode ctype cwidth nbytes lastcol pctype Preprocess // spell-checker:ignore (ToDO) nums aflag uflag scol prevtab amode ctype cwidth nbytes lastcol pctype Preprocess
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use std::error::Error; use std::error::Error;
use std::fmt; use std::fmt;
use std::fs::File; use std::fs::File;
@ -167,7 +167,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.about(ABOUT) .about(ABOUT)
.infer_long_args(true) .infer_long_args(true)

View file

@ -4,8 +4,8 @@
// file that was distributed with this source code. // file that was distributed with this source code.
// spell-checker:ignore badoption // spell-checker:ignore badoption
use clap::{ use clap::{
builder::ValueParser, crate_version, error::ContextKind, error::Error, error::ErrorKind, Arg, builder::ValueParser, error::ContextKind, error::Error, error::ErrorKind, Arg, ArgAction,
ArgAction, ArgMatches, Command, ArgMatches, Command,
}; };
use std::ffi::{OsStr, OsString}; use std::ffi::{OsStr, OsString};
use std::fs::File; use std::fs::File;
@ -599,7 +599,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -8,7 +8,7 @@ use std::fs::remove_file;
use std::path::Path; use std::path::Path;
use clap::builder::ValueParser; use clap::builder::ValueParser;
use clap::{crate_version, Arg, Command}; use clap::{Arg, Command};
use uucore::display::Quotable; use uucore::display::Quotable;
use uucore::error::{FromIo, UResult}; use uucore::error::{FromIo, UResult};
@ -29,7 +29,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -15,7 +15,7 @@ use uucore::uptime::*;
use uucore::error::UResult; use uucore::error::UResult;
use clap::{builder::ValueParser, crate_version, Arg, ArgAction, Command, ValueHint}; use clap::{builder::ValueParser, Arg, ArgAction, Command, ValueHint};
use uucore::{format_usage, help_about, help_usage}; use uucore::{format_usage, help_about, help_usage};
@ -89,7 +89,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -9,7 +9,7 @@ use std::ffi::OsString;
use std::path::Path; use std::path::Path;
use clap::builder::ValueParser; use clap::builder::ValueParser;
use clap::{crate_version, Arg, Command}; use clap::{Arg, Command};
use uucore::error::UResult; use uucore::error::UResult;
use uucore::{format_usage, help_about, help_usage}; use uucore::{format_usage, help_about, help_usage};
@ -87,7 +87,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -20,7 +20,7 @@ use std::{
path::{Path, PathBuf}, path::{Path, PathBuf},
}; };
use clap::{builder::ValueParser, crate_version, Arg, ArgAction, ArgMatches, Command}; use clap::{builder::ValueParser, Arg, ArgAction, ArgMatches, Command};
use thiserror::Error; use thiserror::Error;
use unicode_width::UnicodeWidthChar; use unicode_width::UnicodeWidthChar;
use utf8::{BufReadDecoder, BufReadDecoderError}; use utf8::{BufReadDecoder, BufReadDecoderError};
@ -396,7 +396,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (ToDO) ttyname hostnames runlevel mesg wtmp statted boottime deadprocs initspawn clockchange curr runlvline pidstr exitstr hoststr // spell-checker:ignore (ToDO) ttyname hostnames runlevel mesg wtmp statted boottime deadprocs initspawn clockchange curr runlvline pidstr exitstr hoststr
use clap::{crate_version, Arg, ArgAction, Command}; use clap::{Arg, ArgAction, Command};
use uucore::{format_usage, help_about, help_usage}; use uucore::{format_usage, help_about, help_usage};
mod platform; mod platform;
@ -41,7 +41,7 @@ use platform::uumain;
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -5,7 +5,7 @@
use std::ffi::OsString; use std::ffi::OsString;
use clap::{crate_version, Command}; use clap::Command;
use uucore::display::println_verbatim; use uucore::display::println_verbatim;
use uucore::error::{FromIo, UResult}; use uucore::error::{FromIo, UResult};
@ -31,7 +31,7 @@ pub fn whoami() -> UResult<OsString> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)

View file

@ -5,7 +5,7 @@
// cSpell:ignore strs // cSpell:ignore strs
use clap::{builder::ValueParser, crate_version, Arg, ArgAction, Command}; use clap::{builder::ValueParser, Arg, ArgAction, Command};
use std::error::Error; use std::error::Error;
use std::ffi::OsString; use std::ffi::OsString;
use std::io::{self, Write}; use std::io::{self, Write};
@ -42,7 +42,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(uucore::crate_version!())
.about(ABOUT) .about(ABOUT)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.arg( .arg(

View file

@ -165,6 +165,25 @@ macro_rules! bin {
}; };
} }
/// Generate the version string for clap.
///
/// The generated string has the format `(<project name>) <version>`, for
/// example: "(uutils coreutils) 0.30.0". clap will then prefix it with the util name.
///
/// To use this macro, you have to add `PROJECT_NAME_FOR_VERSION_STRING = "<project name>"` to the
/// `[env]` section in `.cargo/config.toml`.
#[macro_export]
macro_rules! crate_version {
() => {
concat!(
"(",
env!("PROJECT_NAME_FOR_VERSION_STRING"),
") ",
env!("CARGO_PKG_VERSION")
)
};
}
/// Generate the usage string for clap. /// Generate the usage string for clap.
/// ///
/// This function does two things. It indents all but the first line to align /// This function does two things. It indents all but the first line to align

Some files were not shown because too many files have changed in this diff Show more