Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clap 3 #2863

Merged
merged 111 commits into from
Jan 20, 2022
Merged

Clap 3 #2863

Changes from 1 commit
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
67e5ede
basename: clap 3
tertsdiepraam Jan 11, 2022
0fb7ceb
base64: remove clap dependency (handled by base_common)
tertsdiepraam Jan 11, 2022
031bde9
base32: clap 3
tertsdiepraam Jan 11, 2022
7e9529b
arch: clap 3
tertsdiepraam Jan 11, 2022
fb1f9ec
basenc: clap 3
tertsdiepraam Jan 11, 2022
c76a06e
uucore: clap 3
tertsdiepraam Jan 11, 2022
048cfaf
cat: clap 3
tertsdiepraam Jan 11, 2022
f35b132
chcon: clap 3
tertsdiepraam Jan 11, 2022
e4acb64
chgrp: clap 3
tertsdiepraam Jan 11, 2022
2576615
chmod: clap 3
tertsdiepraam Jan 11, 2022
8261cf0
chown: clap 3
tertsdiepraam Jan 11, 2022
16afe58
chroot: clap 3
tertsdiepraam Jan 11, 2022
cf78121
cksum: clap 3
tertsdiepraam Jan 11, 2022
99a3dc3
comm: clap 3
tertsdiepraam Jan 11, 2022
37ab05b
cp: clap 3
tertsdiepraam Jan 11, 2022
88447c2
csplit: clap 3
tertsdiepraam Jan 11, 2022
7a0309a
cut: clap 3
tertsdiepraam Jan 11, 2022
f579727
date: clap 3
tertsdiepraam Jan 11, 2022
11bfb5c
dd: clap 3
tertsdiepraam Jan 11, 2022
7392179
df: clap 3
tertsdiepraam Jan 11, 2022
9bd1c3e
dircolors: clap 3
tertsdiepraam Jan 11, 2022
db1e630
dirname: clap 3
tertsdiepraam Jan 11, 2022
1f2c306
du: clap 3
tertsdiepraam Jan 11, 2022
812f2db
echo: clap 3
tertsdiepraam Jan 11, 2022
4d917e2
env: clap 3
tertsdiepraam Jan 11, 2022
449a536
expand: clap 3
tertsdiepraam Jan 11, 2022
55eb4a2
expr: clap 3
tertsdiepraam Jan 11, 2022
b5ba2fc
factor: clap 3
tertsdiepraam Jan 11, 2022
df5bf0c
false: clap 3
tertsdiepraam Jan 11, 2022
e3e35cb
fmt: clap 3
tertsdiepraam Jan 11, 2022
ebe96f1
fold: clap 3
tertsdiepraam Jan 11, 2022
742fe85
groups: clap 3
tertsdiepraam Jan 11, 2022
6e34d8a
hashsum: clap 3
tertsdiepraam Jan 11, 2022
9fc9fdb
head: clap 3
tertsdiepraam Jan 11, 2022
6876521
hostid: clap 3
tertsdiepraam Jan 11, 2022
82aadbf
hostname: clap 3
tertsdiepraam Jan 11, 2022
8c58f8e
id: clap 3
tertsdiepraam Jan 11, 2022
89112fb
install: clap 3
tertsdiepraam Jan 11, 2022
b614943
join: clap 3
tertsdiepraam Jan 11, 2022
83f3961
kill: clap 3
tertsdiepraam Jan 11, 2022
0531f13
link: clap 3
tertsdiepraam Jan 11, 2022
9951958
ln: clap 3
tertsdiepraam Jan 11, 2022
ebaf5ca
logname: clap 3
tertsdiepraam Jan 11, 2022
c8270b2
ls: clap 3
tertsdiepraam Jan 11, 2022
0e021e9
mkdir: clap 3
tertsdiepraam Jan 11, 2022
c8eddad
mkfifo: clap 3
tertsdiepraam Jan 11, 2022
6e39edd
mknod: clap 3
tertsdiepraam Jan 11, 2022
f902ec7
mktemp: clap 3
tertsdiepraam Jan 11, 2022
41d567f
more: clap 3
tertsdiepraam Jan 11, 2022
ba93684
mv: clap 3
tertsdiepraam Jan 11, 2022
64f57a9
nice: clap 3
tertsdiepraam Jan 11, 2022
5b13ec9
nl: clap 3
tertsdiepraam Jan 11, 2022
5e94435
nohup: clap 3
tertsdiepraam Jan 11, 2022
5702313
nproc: clap 3
tertsdiepraam Jan 11, 2022
7cebb25
numfmt: clap 3
tertsdiepraam Jan 11, 2022
9efd665
od: clap 3
tertsdiepraam Jan 11, 2022
8f7f3d1
paste: clap 3
tertsdiepraam Jan 11, 2022
49b1997
pathchk: clap 3
tertsdiepraam Jan 11, 2022
c39a9b4
pinky: clap 3
tertsdiepraam Jan 11, 2022
8ba1093
printenv: clap 3
tertsdiepraam Jan 11, 2022
b948091
printf: clap 3
tertsdiepraam Jan 11, 2022
24dc4d9
ptx: clap 3
tertsdiepraam Jan 11, 2022
d8f2be2
readlink: clap 3
tertsdiepraam Jan 11, 2022
edafc46
realpath: clap 3
tertsdiepraam Jan 11, 2022
d52887e
pwd: clap 3
tertsdiepraam Jan 11, 2022
a02e40f
relpath: clap 3
tertsdiepraam Jan 11, 2022
283973c
rm: clap 3
tertsdiepraam Jan 11, 2022
f260f60
rmdir: clap 3
tertsdiepraam Jan 11, 2022
4edab26
pr: clap 3
tertsdiepraam Jan 11, 2022
ec42e82
runcon: clap 3
tertsdiepraam Jan 11, 2022
41513a8
seq: clap 3
tertsdiepraam Jan 11, 2022
92e94de
shred: clap 3
tertsdiepraam Jan 11, 2022
793e540
shuf: clap 3
tertsdiepraam Jan 11, 2022
d0a52c9
sleep: clap 3
tertsdiepraam Jan 11, 2022
b43839a
sort: clap 3
tertsdiepraam Jan 11, 2022
ecf6f18
split: clap 3
tertsdiepraam Jan 11, 2022
eaaa162
stat: clap 3
tertsdiepraam Jan 11, 2022
0fca446
stdbuf: clap 3
tertsdiepraam Jan 11, 2022
bad7908
sum: clap 3
tertsdiepraam Jan 11, 2022
5736129
sync: clap 3
tertsdiepraam Jan 11, 2022
219498c
tac: clap 3
tertsdiepraam Jan 11, 2022
9c96438
tail: clap 3
tertsdiepraam Jan 11, 2022
3cac8a6
tee: clap 3
tertsdiepraam Jan 11, 2022
0ff1984
test: clap 3
tertsdiepraam Jan 11, 2022
7318d1d
timeout: clap 3
tertsdiepraam Jan 11, 2022
9f58715
touch: clap 3
tertsdiepraam Jan 11, 2022
fd77786
tr: clap 3
tertsdiepraam Jan 11, 2022
6c37cde
true: clap 3
tertsdiepraam Jan 11, 2022
2633576
truncate: clap 3
tertsdiepraam Jan 11, 2022
48c6593
tty: clap 3
tertsdiepraam Jan 11, 2022
7de993f
uname: clap 3
tertsdiepraam Jan 11, 2022
dafa073
unexpand: clap 3
tertsdiepraam Jan 11, 2022
5105a59
uniq: clap 3
tertsdiepraam Jan 11, 2022
2cd32be
unlink
tertsdiepraam Jan 11, 2022
ac76eef
uptime: clap 3
tertsdiepraam Jan 11, 2022
e5a775b
users: clap 3
tertsdiepraam Jan 11, 2022
e9e5768
wc: clap 3
tertsdiepraam Jan 11, 2022
e3b8e6c
who: clap 3
tertsdiepraam Jan 11, 2022
fe69ad2
whoami: clap 3
tertsdiepraam Jan 11, 2022
e62fdb9
yes: clap 3
tertsdiepraam Jan 11, 2022
49e5412
tsort: clap 3
tertsdiepraam Jan 11, 2022
c93298f
coreutils: clap 3
tertsdiepraam Jan 11, 2022
fc3c82f
update cargo.lock for clap 3.0
tertsdiepraam Jan 11, 2022
8872485
Merge branch 'main' into clap-3
tertsdiepraam Jan 17, 2022
55893f0
od: use clap options instead of custom mock options for unit tests
tertsdiepraam Jan 17, 2022
951f3bb
fix up runcon and chcon for clap 3
tertsdiepraam Jan 17, 2022
270a6ee
rm: fix 3 leading hyphens for ---presume-input-tty
tertsdiepraam Jan 18, 2022
e345768
base64: remove clap dependency again
tertsdiepraam Jan 18, 2022
0a30c43
chcon: use try_get_matches_from
tertsdiepraam Jan 18, 2022
77229ae
ls: fix tests for windows
tertsdiepraam Jan 18, 2022
4b79419
runcon/hashsum: remove references to get_matches_from_safe
tertsdiepraam Jan 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
echo: clap 3
tertsdiepraam committed Jan 11, 2022
commit 812f2db464a5ff2d0c33dbe84c63c95807fba0f7
2 changes: 1 addition & 1 deletion src/uu/echo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ edition = "2018"
path = "src/echo.rs"

[dependencies]
clap = { version = "2.33", features = ["wrap_help"] }
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
uucore = { version=">=0.0.10", package="uucore", path="../../uucore" }
uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" }

33 changes: 13 additions & 20 deletions src/uu/echo/src/echo.rs
Original file line number Diff line number Diff line change
@@ -128,44 +128,37 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
execute(no_newline, escaped, values).map_err_context(|| "could not write to stdout".to_string())
}

pub fn uu_app() -> App<'static, 'static> {
pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name())
.name(NAME)
// TrailingVarArg specifies the final positional argument is a VarArg
// and it doesn't attempts the parse any further args.
// Final argument must have multiple(true) or the usage string equivalent.
.setting(clap::AppSettings::TrailingVarArg)
.setting(clap::AppSettings::AllowLeadingHyphen)
.setting(clap::AppSettings::AllowHyphenValues)
.version(crate_version!())
.about(SUMMARY)
.after_help(AFTER_HELP)
.usage(USAGE)
.override_usage(USAGE)
.arg(
Arg::with_name(options::NO_NEWLINE)
.short("n")
Arg::new(options::NO_NEWLINE)
.short('n')
.help("do not output the trailing newline")
.takes_value(false)
.display_order(1),
.takes_value(false),
)
.arg(
Arg::with_name(options::ENABLE_BACKSLASH_ESCAPE)
.short("e")
Arg::new(options::ENABLE_BACKSLASH_ESCAPE)
.short('e')
.help("enable interpretation of backslash escapes")
.takes_value(false)
.display_order(2),
.takes_value(false),
)
.arg(
Arg::with_name(options::DISABLE_BACKSLASH_ESCAPE)
.short("E")
Arg::new(options::DISABLE_BACKSLASH_ESCAPE)
.short('E')
.help("disable interpretation of backslash escapes (default)")
.takes_value(false)
.display_order(3),
)
.arg(
Arg::with_name(options::STRING)
.multiple(true)
.allow_hyphen_values(true),
.takes_value(false),
)
.arg(Arg::new(options::STRING).multiple_occurrences(true))
}

fn execute(no_newline: bool, escaped: bool, free: Vec<String>) -> io::Result<()> {