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

test: add version and about (#3011)

This commit is contained in:
Guilherme Augusto de Souza 2022-02-04 06:28:15 -03:00 committed by GitHub
parent 033fd62f6a
commit ae755bb9bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,7 +10,7 @@
mod parser;
use clap::{crate_version, App, AppSettings};
use clap::{crate_version, App};
use parser::{parse, Operator, Symbol, UnaryOperator};
use std::ffi::{OsStr, OsString};
use uucore::display::Quotable;
@ -86,10 +86,14 @@ NOTE: your shell may have its own version of test and/or [, which usually supers
the version described here. Please refer to your shell's documentation
for details about the options it supports.";
const ABOUT: &str = "Check file types and compare values.";
pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name())
.setting(AppSettings::DisableHelpFlag)
.setting(AppSettings::DisableVersionFlag)
.version(crate_version!())
.about(ABOUT)
.override_usage(USAGE)
.after_help(AFTER_HELP)
}
#[uucore::main]
@ -104,6 +108,7 @@ pub fn uumain(mut args: impl uucore::Args) -> UResult<()> {
// Let clap pretty-print help and version
App::new(binary_name)
.version(crate_version!())
.about(ABOUT)
.override_usage(USAGE)
.after_help(AFTER_HELP)
// Disable printing of -h and -v as valid alternatives for --help and --version,