mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-07 00:17:47 +00:00
touch: constant for the sources ArgGroup
This commit is contained in:
parent
ed2787a6df
commit
44c390c290
1 changed files with 4 additions and 2 deletions
|
@ -22,6 +22,8 @@ use std::path::Path;
|
||||||
static VERSION: &str = env!("CARGO_PKG_VERSION");
|
static VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||||
static ABOUT: &str = "Update the access and modification times of each FILE to the current time.";
|
static ABOUT: &str = "Update the access and modification times of each FILE to the current time.";
|
||||||
pub mod options {
|
pub mod options {
|
||||||
|
// Both SOURCES and sources are needed as we need to be able to refer to the ArgGroup.
|
||||||
|
pub static SOURCES: &str = "sources";
|
||||||
pub mod sources {
|
pub mod sources {
|
||||||
pub static DATE: &str = "date";
|
pub static DATE: &str = "date";
|
||||||
pub static REFERENCE: &str = "reference";
|
pub static REFERENCE: &str = "reference";
|
||||||
|
@ -121,7 +123,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.min_values(1),
|
.min_values(1),
|
||||||
)
|
)
|
||||||
.group(ArgGroup::with_name("sources").args(&[
|
.group(ArgGroup::with_name(options::SOURCES).args(&[
|
||||||
options::sources::CURRENT,
|
options::sources::CURRENT,
|
||||||
options::sources::DATE,
|
options::sources::DATE,
|
||||||
options::sources::REFERENCE,
|
options::sources::REFERENCE,
|
||||||
|
@ -172,7 +174,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Minor optimization: if no reference time was specified, we're done.
|
// Minor optimization: if no reference time was specified, we're done.
|
||||||
if !matches.is_present("sources") {
|
if !matches.is_present(options::SOURCES) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue