mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 04:27:45 +00:00
dir, vdir: update to clap 4
This commit is contained in:
parent
f432e5809c
commit
67ba0c8195
4 changed files with 26 additions and 26 deletions
|
@ -15,7 +15,7 @@ edition = "2021"
|
||||||
path = "src/dir.rs"
|
path = "src/dir.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "3.2", features = ["wrap_help", "cargo", "env"] }
|
clap = { version = "4.0", features = ["wrap_help", "cargo", "env"] }
|
||||||
uucore = { version=">=0.0.16", package="uucore", path="../../uucore", features=["entries", "fs"] }
|
uucore = { version=">=0.0.16", package="uucore", path="../../uucore", features=["entries", "fs"] }
|
||||||
selinux = { version = "0.3", optional = true }
|
selinux = { version = "0.3", optional = true }
|
||||||
uu_ls = { version = ">=0.0.16", path="../ls"}
|
uu_ls = { version = ">=0.0.16", path="../ls"}
|
||||||
|
|
|
@ -25,21 +25,21 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||||
// If not, we will use dir default formatting and quoting style options
|
// If not, we will use dir default formatting and quoting style options
|
||||||
|
|
||||||
if !matches.contains_id(options::QUOTING_STYLE)
|
if !matches.contains_id(options::QUOTING_STYLE)
|
||||||
&& !matches.contains_id(options::quoting::C)
|
&& !matches.get_flag(options::quoting::C)
|
||||||
&& !matches.contains_id(options::quoting::ESCAPE)
|
&& !matches.get_flag(options::quoting::ESCAPE)
|
||||||
&& !matches.contains_id(options::quoting::LITERAL)
|
&& !matches.get_flag(options::quoting::LITERAL)
|
||||||
{
|
{
|
||||||
default_quoting_style = true;
|
default_quoting_style = true;
|
||||||
}
|
}
|
||||||
if !matches.contains_id(options::FORMAT)
|
if !matches.contains_id(options::FORMAT)
|
||||||
&& !matches.contains_id(options::format::ACROSS)
|
&& !matches.get_flag(options::format::ACROSS)
|
||||||
&& !matches.contains_id(options::format::COLUMNS)
|
&& !matches.get_flag(options::format::COLUMNS)
|
||||||
&& !matches.contains_id(options::format::COMMAS)
|
&& !matches.get_flag(options::format::COMMAS)
|
||||||
&& !matches.contains_id(options::format::LONG)
|
&& !matches.get_flag(options::format::LONG)
|
||||||
&& !matches.contains_id(options::format::LONG_NO_GROUP)
|
&& !matches.get_flag(options::format::LONG_NO_GROUP)
|
||||||
&& !matches.contains_id(options::format::LONG_NO_OWNER)
|
&& !matches.get_flag(options::format::LONG_NO_OWNER)
|
||||||
&& !matches.contains_id(options::format::LONG_NUMERIC_UID_GID)
|
&& !matches.get_flag(options::format::LONG_NUMERIC_UID_GID)
|
||||||
&& !matches.contains_id(options::format::ONE_LINE)
|
&& !matches.get_flag(options::format::ONE_LINE)
|
||||||
{
|
{
|
||||||
default_format_style = true;
|
default_format_style = true;
|
||||||
}
|
}
|
||||||
|
@ -66,6 +66,6 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||||
// To avoid code duplication, we reuse ls uu_app function which has the same
|
// To avoid code duplication, we reuse ls uu_app function which has the same
|
||||||
// arguments. However, coreutils won't compile if one of the utils is missing
|
// arguments. However, coreutils won't compile if one of the utils is missing
|
||||||
// an uu_app function, so we return the `ls` app.
|
// an uu_app function, so we return the `ls` app.
|
||||||
pub fn uu_app<'a>() -> Command<'a> {
|
pub fn uu_app() -> Command {
|
||||||
uu_ls::uu_app()
|
uu_ls::uu_app()
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ edition = "2021"
|
||||||
path = "src/vdir.rs"
|
path = "src/vdir.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "3.2", features = ["wrap_help", "cargo", "env"] }
|
clap = { version = "4.0", features = ["wrap_help", "cargo", "env"] }
|
||||||
uucore = { version=">=0.0.16", package="uucore", path="../../uucore", features=["entries", "fs"] }
|
uucore = { version=">=0.0.16", package="uucore", path="../../uucore", features=["entries", "fs"] }
|
||||||
selinux = { version="0.3", optional = true }
|
selinux = { version="0.3", optional = true }
|
||||||
uu_ls = { version = ">=0.0.16", path="../ls"}
|
uu_ls = { version = ">=0.0.16", path="../ls"}
|
||||||
|
|
|
@ -24,21 +24,21 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||||
// If not, we will use dir default formatting and quoting style options
|
// If not, we will use dir default formatting and quoting style options
|
||||||
|
|
||||||
if !matches.contains_id(options::QUOTING_STYLE)
|
if !matches.contains_id(options::QUOTING_STYLE)
|
||||||
&& !matches.contains_id(options::quoting::C)
|
&& !matches.get_flag(options::quoting::C)
|
||||||
&& !matches.contains_id(options::quoting::ESCAPE)
|
&& !matches.get_flag(options::quoting::ESCAPE)
|
||||||
&& !matches.contains_id(options::quoting::LITERAL)
|
&& !matches.get_flag(options::quoting::LITERAL)
|
||||||
{
|
{
|
||||||
default_quoting_style = true;
|
default_quoting_style = true;
|
||||||
}
|
}
|
||||||
if !matches.contains_id(options::FORMAT)
|
if !matches.contains_id(options::FORMAT)
|
||||||
&& !matches.contains_id(options::format::ACROSS)
|
&& !matches.get_flag(options::format::ACROSS)
|
||||||
&& !matches.contains_id(options::format::COLUMNS)
|
&& !matches.get_flag(options::format::COLUMNS)
|
||||||
&& !matches.contains_id(options::format::COMMAS)
|
&& !matches.get_flag(options::format::COMMAS)
|
||||||
&& !matches.contains_id(options::format::LONG)
|
&& !matches.get_flag(options::format::LONG)
|
||||||
&& !matches.contains_id(options::format::LONG_NO_GROUP)
|
&& !matches.get_flag(options::format::LONG_NO_GROUP)
|
||||||
&& !matches.contains_id(options::format::LONG_NO_OWNER)
|
&& !matches.get_flag(options::format::LONG_NO_OWNER)
|
||||||
&& !matches.contains_id(options::format::LONG_NUMERIC_UID_GID)
|
&& !matches.get_flag(options::format::LONG_NUMERIC_UID_GID)
|
||||||
&& !matches.contains_id(options::format::ONE_LINE)
|
&& !matches.get_flag(options::format::ONE_LINE)
|
||||||
{
|
{
|
||||||
default_format_style = true;
|
default_format_style = true;
|
||||||
}
|
}
|
||||||
|
@ -64,6 +64,6 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||||
// To avoid code duplication, we reuse ls uu_app function which has the same
|
// To avoid code duplication, we reuse ls uu_app function which has the same
|
||||||
// arguments. However, coreutils won't compile if one of the utils is missing
|
// arguments. However, coreutils won't compile if one of the utils is missing
|
||||||
// an uu_app function, so we need this dummy one.
|
// an uu_app function, so we need this dummy one.
|
||||||
pub fn uu_app<'a>() -> Command<'a> {
|
pub fn uu_app() -> Command {
|
||||||
uu_ls::uu_app()
|
uu_ls::uu_app()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue