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

Merge branch 'master' into clap-pwd

This commit is contained in:
Sylvestre Ledru 2020-11-19 22:32:02 +01:00 committed by GitHub
commit 8271faf3a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
132 changed files with 3646 additions and 749 deletions

View file

@ -1,7 +1,7 @@
name: CICD name: CICD
# spell-checker:ignore (acronyms) CICD MSVC musl # spell-checker:ignore (acronyms) CICD MSVC musl
# spell-checker:ignore (env/flags) Ccodegen Coverflow Cpanic RUSTDOCFLAGS RUSTFLAGS Zpanic # spell-checker:ignore (env/flags) Awarnings Ccodegen Coverflow Cpanic RUSTDOCFLAGS RUSTFLAGS Zpanic
# spell-checker:ignore (jargon) SHAs deps softprops toolchain # spell-checker:ignore (jargon) SHAs deps softprops toolchain
# spell-checker:ignore (names) CodeCOV MacOS MinGW Peltoche rivy # spell-checker:ignore (names) CodeCOV MacOS MinGW Peltoche rivy
# spell-checker:ignore (shell/tools) choco clippy dmake dpkg esac fakeroot gmake grcov halium lcov libssl mkdir popd printf pushd rustc rustfmt rustup shopt xargs # spell-checker:ignore (shell/tools) choco clippy dmake dpkg esac fakeroot gmake grcov halium lcov libssl mkdir popd printf pushd rustc rustfmt rustup shopt xargs
@ -145,10 +145,6 @@ jobs:
cargo fetch --locked --quiet cargo fetch --locked --quiet
## * using the 'stable' toolchain is necessary to avoid "unexpected '--filter-platform'" errors ## * using the 'stable' toolchain is necessary to avoid "unexpected '--filter-platform'" errors
RUSTUP_TOOLCHAIN=stable cargo-tree tree --frozen --all --no-dev-dependencies --no-indent --features ${{ matrix.job.features }} | grep -vE "$PWD" | sort --unique RUSTUP_TOOLCHAIN=stable cargo-tree tree --frozen --all --no-dev-dependencies --no-indent --features ${{ matrix.job.features }} | grep -vE "$PWD" | sort --unique
- name: Info
shell: bash
run: |
# Info
- name: Test - name: Test
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1

55
.vscode/cSpell.json vendored
View file

@ -8,6 +8,8 @@
"Cygwin", "Cygwin",
"FreeBSD", "FreeBSD",
"Gmail", "Gmail",
"GNUEABI",
"GNUEABIhf",
"Irix", "Irix",
"MacOS", "MacOS",
"MinGW", "MinGW",
@ -23,16 +25,31 @@
"Xenix", "Xenix",
"flac", "flac",
"lzma", "lzma",
// cargo
"cdylib",
"rlib",
// crates // crates
"advapi",
"advapi32-sys",
"aho-corasick",
"backtrace",
"byteorder", "byteorder",
"chacha",
"chrono", "chrono",
"conv",
"corasick",
"filetime", "filetime",
"formatteriteminfo", "formatteriteminfo",
"getopts", "getopts",
"itertools", "itertools",
"memchr",
"multifilereader", "multifilereader",
"onig", "onig",
"peekreader", "peekreader",
"quickcheck",
"rand_chacha",
"smallvec",
"tempfile",
"termion", "termion",
"termios", "termios",
"termsize", "termsize",
@ -64,12 +81,14 @@
"colorize", "colorize",
"consts", "consts",
"dedup", "dedup",
"demangle",
"deque", "deque",
"dequeue", "dequeue",
"enqueue", "enqueue",
"executable", "executable",
"executables", "executables",
"gibibytes", "gibibytes",
"hardfloat",
"hardlink", "hardlink",
"hardlinks", "hardlinks",
"hashsums", "hashsums",
@ -87,9 +106,12 @@
"primality", "primality",
"pseudoprime", "pseudoprime",
"pseudoprimes", "pseudoprimes",
"procs",
"readonly", "readonly",
"seedable", "seedable",
"semver", "semver",
"shortcode",
"shortcodes",
"symlink", "symlink",
"symlinks", "symlinks",
"syscall", "syscall",
@ -144,6 +166,7 @@
"Sunrin SHIMURA", "Sunrin", "SHIMURA", "Sunrin SHIMURA", "Sunrin", "SHIMURA",
"Smigle00", "Smigle", "Smigle00", "Smigle",
"Sylvestre Ledru", "Sylvestre", "Ledru", "Sylvestre Ledru", "Sylvestre", "Ledru",
"T Jameson Little", "Jameson", "Little",
"Tobias Bohumir Schottdorf", "Tobias", "Bohumir", "Schottdorf", "Tobias Bohumir Schottdorf", "Tobias", "Bohumir", "Schottdorf",
"Virgile Andreani", "Virgile", "Andreani", "Virgile Andreani", "Virgile", "Andreani",
"Vsevolod Velichko", "Vsevolod", "Velichko", "Vsevolod Velichko", "Vsevolod", "Velichko",
@ -151,27 +174,37 @@
"Yury Krivopalov", "Yury", "Krivopalov", "Yury Krivopalov", "Yury", "Krivopalov",
"anonymousknight", "anonymousknight",
"kwantam", "kwantam",
"nicoo",
"rivy",
// rust // rust
"clippy", "clippy",
"concat", "concat",
"fract",
"powi", "powi",
"println",
"repr", "repr",
"rfind", "rfind",
"rustc", "rustc",
"rustfmt", "rustfmt",
"struct",
"structs",
"substr", "substr",
"splitn", "splitn",
"trunc",
// shell // shell
"passwd", "passwd",
"pipefail",
"tcsh", "tcsh",
// tags // tags
"Maint", "Maint",
// uutils // uutils
"chcon",
"chgrp", "chgrp",
"chmod", "chmod",
"chown", "chown",
"chroot", "chroot",
"cksum", "cksum",
"csplit",
"dircolors", "dircolors",
"hashsum", "hashsum",
"hostid", "hostid",
@ -190,16 +223,28 @@
"realpath", "realpath",
"relpath", "relpath",
"rmdir", "rmdir",
"runcon",
"shuf", "shuf",
"stdbuf", "stdbuf",
"stty",
"tsort", "tsort",
"uname", "uname",
"unexpand", "unexpand",
"whoami", "whoami",
// vars/errno
"errno",
"EOPNOTSUPP",
// vars/fcntl
"F_GETFL",
"GETFL",
"fcntl",
"vmsplice",
// vars/libc // vars/libc
"FILENO", "FILENO",
"HOSTSIZE", "HOSTSIZE",
"IDSIZE", "IDSIZE",
"IFIFO",
"IFREG",
"IRGRP", "IRGRP",
"IROTH", "IROTH",
"IRUSR", "IRUSR",
@ -240,10 +285,16 @@
"socktype", "socktype",
"umask", "umask",
"waitpid", "waitpid",
// vars/nix
"iovec",
"unistd",
// vars/signals // vars/signals
"SIGPIPE", "SIGPIPE",
// vars/sync // vars/sync
"Condvar", "Condvar",
// vars/stat
"fstat",
"stat",
// vars/time // vars/time
"Timespec", "Timespec",
"nsec", "nsec",
@ -265,9 +316,11 @@
"errhandlingapi", "errhandlingapi",
"fileapi", "fileapi",
"handleapi", "handleapi",
"lmcons",
"minwindef", "minwindef",
"processthreadsapi", "processthreadsapi",
"synchapi", "synchapi",
"sysinfoapi",
"winbase", "winbase",
"winerror", "winerror",
"winnt", "winnt",
@ -285,10 +338,12 @@
"coreopts", "coreopts",
"coreutils", "coreutils",
"libc", "libc",
"libstdbuf",
"musl", "musl",
"ucmd", "ucmd",
"utmpx", "utmpx",
"uucore", "uucore",
"uucore_procs",
"uumain", "uumain",
"uutils" "uutils"
], ],

2
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,2 @@
{
}

409
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -225,7 +225,7 @@ test = [ "uu_test" ]
[dependencies] [dependencies]
lazy_static = { version="1.3" } lazy_static = { version="1.3" }
textwrap = { version="=0.11.0", features=["term_size"] } # !maint: [2020-05-10; rivy] unstable crate using undocumented features; pinned currently, will review textwrap = { version="=0.11.0", features=["term_size"] } # !maint: [2020-05-10; rivy] unstable crate using undocumented features; pinned currently, will review
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="src/uucore" }
# * uutils # * uutils
uu_test = { optional=true, version="0.0.1", package="uu_test", path="src/uu/test" } uu_test = { optional=true, version="0.0.1", package="uu_test", path="src/uu/test" }
# #
@ -324,6 +324,7 @@ whoami = { optional=true, version="0.0.1", package="uu_whoami", path="src/uu/w
yes = { optional=true, version="0.0.1", package="uu_yes", path="src/uu/yes" } yes = { optional=true, version="0.0.1", package="uu_yes", path="src/uu/yes" }
# #
# * pinned transitive dependencies # * pinned transitive dependencies
pin_cc = { version="1.0.61, < 1.0.62", package="cc" } ## cc v1.0.62 has compiler errors for MinRustV v1.32.0, requires 1.34 (for `std::str::split_ascii_whitespace()`)
pin_rustc-demangle = { version="0.1.16, < 0.1.17", package="rustc-demangle" } ## rust-demangle v0.1.17 has compiler errors for MinRustV v1.32.0, expects 1.33 pin_rustc-demangle = { version="0.1.16, < 0.1.17", package="rustc-demangle" } ## rust-demangle v0.1.17 has compiler errors for MinRustV v1.32.0, expects 1.33
pin_same-file = { version="1.0.4, < 1.0.6", package="same-file" } ## same-file v1.0.6 has compiler errors for MinRustV v1.32.0, expects 1.34 pin_same-file = { version="1.0.4, < 1.0.6", package="same-file" } ## same-file v1.0.6 has compiler errors for MinRustV v1.32.0, expects 1.34
pin_winapi-util = { version="0.1.2, < 0.1.3", package="winapi-util" } ## winapi-util v0.1.3 has compiler errors for MinRustV v1.32.0, expects 1.34 pin_winapi-util = { version="0.1.2, < 0.1.3", package="winapi-util" } ## winapi-util v0.1.3 has compiler errors for MinRustV v1.32.0, expects 1.34
@ -338,7 +339,7 @@ sha1 = { version="0.6", features=["std"] }
tempfile = "3.1" tempfile = "3.1"
time = "0.1" time = "0.1"
unindent = "0.1" unindent = "0.1"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features=["entries"] } uucore = { version=">=0.0.4", package="uucore", path="src/uucore", features=["entries"] }
[target.'cfg(unix)'.dev-dependencies] [target.'cfg(unix)'.dev-dependencies]
rust-users = { version="0.10", package="users" } rust-users = { version="0.10", package="users" }

View file

@ -16,8 +16,8 @@ path = "src/arch.rs"
[dependencies] [dependencies]
platform-info = "0.0.1" platform-info = "0.0.1"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "arch" name = "arch"

View file

@ -15,8 +15,8 @@ edition = "2018"
path = "src/base32.rs" path = "src/base32.rs"
[dependencies] [dependencies]
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features = ["encoding"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features = ["encoding"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "base32" name = "base32"

View file

@ -15,8 +15,8 @@ edition = "2018"
path = "src/base64.rs" path = "src/base64.rs"
[dependencies] [dependencies]
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features = ["encoding"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features = ["encoding"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "base64" name = "base64"

View file

@ -15,8 +15,8 @@ edition = "2018"
path = "src/basename.rs" path = "src/basename.rs"
[dependencies] [dependencies]
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "basename" name = "basename"

View file

@ -16,8 +16,8 @@ path = "src/cat.rs"
[dependencies] [dependencies]
quick-error = "1.2.3" quick-error = "1.2.3"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features=["fs"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features=["fs"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[target.'cfg(unix)'.dependencies] [target.'cfg(unix)'.dependencies]
unix_socket = "0.5.0" unix_socket = "0.5.0"

View file

@ -15,8 +15,8 @@ edition = "2018"
path = "src/chgrp.rs" path = "src/chgrp.rs"
[dependencies] [dependencies]
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features=["entries", "fs"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features=["entries", "fs"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
walkdir = "2.2.8" walkdir = "2.2.8"
[[bin]] [[bin]]

View file

@ -16,8 +16,8 @@ path = "src/chmod.rs"
[dependencies] [dependencies]
libc = "0.2.42" libc = "0.2.42"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features=["fs", "mode"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features=["fs", "mode"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
walker = "1.0.0" walker = "1.0.0"
[[bin]] [[bin]]

View file

@ -16,8 +16,8 @@ path = "src/chown.rs"
[dependencies] [dependencies]
glob = "0.3.0" glob = "0.3.0"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features=["entries", "fs"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features=["entries", "fs"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
walkdir = "2.2" walkdir = "2.2"
[[bin]] [[bin]]

View file

@ -16,8 +16,8 @@ path = "src/chroot.rs"
[dependencies] [dependencies]
getopts = "0.2.18" getopts = "0.2.18"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features=["entries"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features=["entries"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "chroot" name = "chroot"

View file

@ -16,8 +16,8 @@ path = "src/cksum.rs"
[dependencies] [dependencies]
libc = "0.2.42" libc = "0.2.42"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "cksum" name = "cksum"

View file

@ -17,8 +17,8 @@ path = "src/comm.rs"
[dependencies] [dependencies]
getopts = "0.2.18" getopts = "0.2.18"
libc = "0.2.42" libc = "0.2.42"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "comm" name = "comm"

View file

@ -23,8 +23,8 @@ clap = "2.32"
filetime = "0.2" filetime = "0.2"
libc = "0.2.42" libc = "0.2.42"
quick-error = "1.2.3" quick-error = "1.2.3"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features=["fs"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features=["fs"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
walkdir = "2.2.8" walkdir = "2.2.8"
[target.'cfg(target_os = "linux")'.dependencies] [target.'cfg(target_os = "linux")'.dependencies]

View file

@ -15,8 +15,8 @@ edition = "2018"
path = "src/cut.rs" path = "src/cut.rs"
[dependencies] [dependencies]
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "cut" name = "cut"

View file

@ -17,8 +17,8 @@ path = "src/date.rs"
[dependencies] [dependencies]
chrono = "0.4.4" chrono = "0.4.4"
clap = "2.32" clap = "2.32"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "date" name = "date"

View file

@ -18,8 +18,8 @@ path = "src/df.rs"
clap = "2.32" clap = "2.32"
libc = "0.2" libc = "0.2"
number_prefix = "0.2" number_prefix = "0.2"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[target.'cfg(target_os = "windows")'.dependencies] [target.'cfg(target_os = "windows")'.dependencies]
winapi = { version = "0.3", features = ["errhandlingapi", "fileapi", "handleapi", "winerror"] } winapi = { version = "0.3", features = ["errhandlingapi", "fileapi", "handleapi", "winerror"] }

View file

@ -16,8 +16,8 @@ path = "src/dircolors.rs"
[dependencies] [dependencies]
glob = "0.3.0" glob = "0.3.0"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "dircolors" name = "dircolors"

View file

@ -16,8 +16,8 @@ path = "src/dirname.rs"
[dependencies] [dependencies]
libc = "0.2.42" libc = "0.2.42"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "dirname" name = "dirname"

View file

@ -16,8 +16,8 @@ path = "src/du.rs"
[dependencies] [dependencies]
time = "0.1.40" time = "0.1.40"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "du" name = "du"

View file

@ -15,8 +15,8 @@ edition = "2018"
path = "src/echo.rs" path = "src/echo.rs"
[dependencies] [dependencies]
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "echo" name = "echo"

View file

@ -18,8 +18,8 @@ path = "src/env.rs"
clap = "2.33" clap = "2.33"
libc = "0.2.42" libc = "0.2.42"
rust-ini = "0.13.0" rust-ini = "0.13.0"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "env" name = "env"

View file

@ -17,8 +17,8 @@ path = "src/expand.rs"
[dependencies] [dependencies]
getopts = "0.2.18" getopts = "0.2.18"
unicode-width = "0.1.5" unicode-width = "0.1.5"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "expand" name = "expand"

View file

@ -17,8 +17,8 @@ path = "src/expr.rs"
[dependencies] [dependencies]
libc = "0.2.42" libc = "0.2.42"
onig = "~4.3.2" onig = "~4.3.2"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "expr" name = "expr"

View file

@ -19,8 +19,8 @@ num-traits = "0.2" # used in src/numerics.rs, which is included by build.rs
num-traits = "0.2" num-traits = "0.2"
rand = { version="0.7", features=["small_rng"] } rand = { version="0.7", features=["small_rng"] }
smallvec = { version="0.6.13, < 1.0" } smallvec = { version="0.6.13, < 1.0" }
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[dev-dependencies] [dev-dependencies]
criterion = "0.3" criterion = "0.3"

View file

@ -15,8 +15,8 @@ edition = "2018"
path = "src/false.rs" path = "src/false.rs"
[dependencies] [dependencies]
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "false" name = "false"

View file

@ -17,8 +17,8 @@ path = "src/fmt.rs"
[dependencies] [dependencies]
libc = "0.2.42" libc = "0.2.42"
unicode-width = "0.1.5" unicode-width = "0.1.5"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "fmt" name = "fmt"

View file

@ -15,8 +15,8 @@ edition = "2018"
path = "src/fold.rs" path = "src/fold.rs"
[dependencies] [dependencies]
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "fold" name = "fold"

View file

@ -15,8 +15,8 @@ edition = "2018"
path = "src/groups.rs" path = "src/groups.rs"
[dependencies] [dependencies]
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features=["entries"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features=["entries"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
clap = "2.32" clap = "2.32"
[[bin]] [[bin]]

View file

@ -25,8 +25,8 @@ regex-syntax = "0.6.7"
sha1 = "0.6.0" sha1 = "0.6.0"
sha2 = "0.6.0" sha2 = "0.6.0"
sha3 = "0.6.0" sha3 = "0.6.0"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "hashsum" name = "hashsum"

View file

@ -16,8 +16,8 @@ path = "src/head.rs"
[dependencies] [dependencies]
libc = "0.2.42" libc = "0.2.42"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "head" name = "head"

View file

@ -16,8 +16,8 @@ path = "src/hostid.rs"
[dependencies] [dependencies]
libc = "0.2.42" libc = "0.2.42"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "hostid" name = "hostid"

View file

@ -18,8 +18,8 @@ path = "src/hostname.rs"
clap = "2.32" clap = "2.32"
libc = "0.2.42" libc = "0.2.42"
hostname = { version = "0.3", features = ["set"] } hostname = { version = "0.3", features = ["set"] }
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features=["wide"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features=["wide"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
winapi = { version="0.3", features=["sysinfoapi", "winsock2"] } winapi = { version="0.3", features=["sysinfoapi", "winsock2"] }
[[bin]] [[bin]]

View file

@ -15,8 +15,8 @@ edition = "2018"
path = "src/id.rs" path = "src/id.rs"
[dependencies] [dependencies]
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features=["entries", "process"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features=["entries", "process"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "id" name = "id"

View file

@ -18,10 +18,10 @@ edition = "2018"
path = "src/install.rs" path = "src/install.rs"
[dependencies] [dependencies]
getopts = "0.2.18" clap = "2.33"
libc = ">= 0.2" libc = ">= 0.2"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features=["mode"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features=["mode"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[dev-dependencies] [dev-dependencies]
time = "0.1.40" time = "0.1.40"

View file

@ -7,7 +7,7 @@
// spell-checker:ignore (ToDO) rwxr sourcepath targetpath // spell-checker:ignore (ToDO) rwxr sourcepath targetpath
extern crate getopts; extern crate clap;
extern crate libc; extern crate libc;
mod mode; mod mode;
@ -15,16 +15,12 @@ mod mode;
#[macro_use] #[macro_use]
extern crate uucore; extern crate uucore;
use clap::{App, Arg, ArgMatches};
use std::fs; use std::fs;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::result::Result; use std::result::Result;
static NAME: &str = "install"; const DEFAULT_MODE: u32 = 0o755;
static SUMMARY: &str = "Copy SOURCE to DEST or multiple SOURCE(s) to the existing
DIRECTORY, while setting permission modes and owner/group";
static LONG_HELP: &str = "";
const DEFAULT_MODE: u32 = 755;
#[allow(dead_code)] #[allow(dead_code)]
pub struct Behavior { pub struct Behavior {
@ -52,14 +48,179 @@ impl Behavior {
} }
} }
static ABOUT: &str = "Copy SOURCE to DEST or multiple SOURCE(s) to the existing
DIRECTORY, while setting permission modes and owner/group";
static VERSION: &str = env!("CARGO_PKG_VERSION");
static OPT_COMPARE: &str = "compare";
static OPT_BACKUP: &str = "backup";
static OPT_BACKUP_2: &str = "backup2";
static OPT_DIRECTORY: &str = "directory";
static OPT_IGNORED: &str = "ignored";
static OPT_CREATED: &str = "created";
static OPT_GROUP: &str = "group";
static OPT_MODE: &str = "mode";
static OPT_OWNER: &str = "owner";
static OPT_PRESERVE_TIMESTAMPS: &str = "preserve-timestamps";
static OPT_STRIP: &str = "strip";
static OPT_STRIP_PROGRAM: &str = "strip-program";
static OPT_SUFFIX: &str = "suffix";
static OPT_TARGET_DIRECTORY: &str = "target-directory";
static OPT_NO_TARGET_DIRECTORY: &str = "no-target-directory";
static OPT_VERBOSE: &str = "verbose";
static OPT_PRESERVE_CONTEXT: &str = "preserve-context";
static OPT_CONTEXT: &str = "context";
static ARG_FILES: &str = "files";
fn get_usage() -> String {
format!("{0} [OPTION]... [FILE]...", executable!())
}
/// Main install utility function, called from main.rs. /// Main install utility function, called from main.rs.
/// ///
/// Returns a program return code. /// Returns a program return code.
/// ///
pub fn uumain(args: impl uucore::Args) -> i32 { pub fn uumain(args: impl uucore::Args) -> i32 {
let args = args.collect_str(); let usage = get_usage();
let matches = parse_opts(args); let matches = App::new(executable!())
.version(VERSION)
.about(ABOUT)
.usage(&usage[..])
.arg(
Arg::with_name(OPT_BACKUP)
.long(OPT_BACKUP)
.help("(unimplemented) make a backup of each existing destination file")
.value_name("CONTROL")
)
.arg(
// TODO implement flag
Arg::with_name(OPT_BACKUP_2)
.short("b")
.help("(unimplemented) like --backup but does not accept an argument")
)
.arg(
Arg::with_name(OPT_IGNORED)
.short("c")
.help("ignored")
)
.arg(
// TODO implement flag
Arg::with_name(OPT_COMPARE)
.short("C")
.long(OPT_COMPARE)
.help("(unimplemented) compare each pair of source and destination files, and in some cases, do not modify the destination at all")
)
.arg(
Arg::with_name(OPT_DIRECTORY)
.short("d")
.long(OPT_DIRECTORY)
.help("treat all arguments as directory names. create all components of the specified directories")
)
.arg(
// TODO implement flag
Arg::with_name(OPT_CREATED)
.short("D")
.help("(unimplemented) create all leading components of DEST except the last, then copy SOURCE to DEST")
)
.arg(
// TODO implement flag
Arg::with_name(OPT_GROUP)
.short("g")
.long(OPT_GROUP)
.help("(unimplemented) set group ownership, instead of process's current group")
.value_name("GROUP")
)
.arg(
Arg::with_name(OPT_MODE)
.short("m")
.long(OPT_MODE)
.help("set permission mode (as in chmod), instead of rwxr-xr-x")
.value_name("MODE")
)
.arg(
// TODO implement flag
Arg::with_name(OPT_OWNER)
.short("o")
.long(OPT_OWNER)
.help("(unimplemented) set ownership (super-user only)")
.value_name("OWNER")
)
.arg(
// TODO implement flag
Arg::with_name(OPT_PRESERVE_TIMESTAMPS)
.short("p")
.long(OPT_PRESERVE_TIMESTAMPS)
.help("(unimplemented) apply access/modification times of SOURCE files to corresponding destination files")
)
.arg(
// TODO implement flag
Arg::with_name(OPT_STRIP)
.short("s")
.long(OPT_STRIP)
.help("(unimplemented) strip symbol tables")
)
.arg(
// TODO implement flag
Arg::with_name(OPT_STRIP_PROGRAM)
.long(OPT_STRIP_PROGRAM)
.help("(unimplemented) program used to strip binaries")
.value_name("PROGRAM")
)
.arg(
// TODO implement flag
Arg::with_name(OPT_SUFFIX)
.short("S")
.long(OPT_SUFFIX)
.help("(unimplemented) override the usual backup suffix")
.value_name("SUFFIX")
)
.arg(
// TODO implement flag
Arg::with_name(OPT_TARGET_DIRECTORY)
.short("t")
.long(OPT_TARGET_DIRECTORY)
.help("(unimplemented) move all SOURCE arguments into DIRECTORY")
.value_name("DIRECTORY")
)
.arg(
// TODO implement flag
Arg::with_name(OPT_NO_TARGET_DIRECTORY)
.short("T")
.long(OPT_NO_TARGET_DIRECTORY)
.help("(unimplemented) treat DEST as a normal file")
)
.arg(
Arg::with_name(OPT_VERBOSE)
.short("v")
.long(OPT_VERBOSE)
.help("explain what is being done")
)
.arg(
// TODO implement flag
Arg::with_name(OPT_PRESERVE_CONTEXT)
.short("P")
.long(OPT_PRESERVE_CONTEXT)
.help("(unimplemented) preserve security context")
)
.arg(
// TODO implement flag
Arg::with_name(OPT_CONTEXT)
.short("Z")
.long(OPT_CONTEXT)
.help("(unimplemented) set security context of files and directories")
.value_name("CONTEXT")
)
.arg(Arg::with_name(ARG_FILES).multiple(true).takes_value(true))
.get_matches_from(args);
let paths: Vec<String> = matches
.values_of(ARG_FILES)
.map(|v| v.map(ToString::to_string).collect())
.unwrap_or_default();
if let Err(s) = check_unimplemented(&matches) { if let Err(s) = check_unimplemented(&matches) {
show_error!("Unimplemented feature: {}", s); show_error!("Unimplemented feature: {}", s);
@ -73,146 +234,12 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
} }
}; };
let paths: Vec<PathBuf> = {
#[allow(clippy::ptr_arg)]
fn string_to_path(s: &String) -> &Path {
Path::new(s)
};
let to_owned = |p: &Path| p.to_owned();
let arguments = matches.free.iter().map(string_to_path);
arguments.map(to_owned).collect()
};
match behavior.main_function { match behavior.main_function {
MainFunction::Directory => directory(&paths[..], behavior), MainFunction::Directory => directory(paths, behavior),
MainFunction::Standard => standard(&paths[..], behavior), MainFunction::Standard => standard(paths, behavior),
} }
} }
/// Build a specification of the command line.
///
/// Returns a getopts::Options struct.
///
fn parse_opts(args: Vec<String>) -> getopts::Matches {
let syntax = format!(
"SOURCE DEST
{} SOURCE... DIRECTORY",
NAME
);
app!(&syntax, SUMMARY, LONG_HELP)
// TODO implement flag
.optflagopt(
"",
"backup",
"(unimplemented) make a backup of each existing destination\n \
file",
"CONTROL",
)
// TODO implement flag
.optflag(
"b",
"",
"(unimplemented) like --backup but does not accept an argument",
)
.optflag("c", "", "ignored")
// TODO implement flag
.optflag(
"C",
"compare",
"(unimplemented) compare each pair of source and destination\n \
files, and in some cases, do not modify the destination at all",
)
.optflag(
"d",
"directory",
"treat all arguments as directory names.\n \
create all components of the specified directories",
)
// TODO implement flag
.optflag(
"D",
"",
"(unimplemented) create all leading components of DEST except the\n \
last, then copy SOURCE to DEST",
)
// TODO implement flag
.optflagopt(
"g",
"group",
"(unimplemented) set group ownership, instead of process's\n \
current group",
"GROUP",
)
.optflagopt(
"m",
"mode",
"set permission mode (as in chmod), instead\n \
of rwxr-xr-x",
"MODE",
)
// TODO implement flag
.optflagopt(
"o",
"owner",
"(unimplemented) set ownership (super-user only)",
"OWNER",
)
// TODO implement flag
.optflag(
"p",
"preserve-timestamps",
"(unimplemented) apply access/modification times\n \
of SOURCE files to corresponding destination files",
)
// TODO implement flag
.optflag("s", "strip", "(unimplemented) strip symbol tables")
// TODO implement flag
.optflagopt(
"",
"strip-program",
"(unimplemented) program used to strip binaries",
"PROGRAM",
)
// TODO implement flag
.optopt(
"S",
"suffix",
"(unimplemented) override the usual backup suffix",
"SUFFIX",
)
// TODO implement flag
.optopt(
"t",
"target-directory",
"(unimplemented) move all SOURCE arguments into\n \
DIRECTORY",
"DIRECTORY",
)
// TODO implement flag
.optflag(
"T",
"no-target-directory",
"(unimplemented) treat DEST as a normal file",
)
.optflag("v", "verbose", "explain what is being done")
// TODO implement flag
.optflag(
"P",
"preserve-context",
"(unimplemented) preserve security context",
)
// TODO implement flag
.optflagopt(
"Z",
"context",
"(unimplemented) set security context of files and\n \
directories",
"CONTEXT",
)
.parse(args)
}
/// Check for unimplemented command line arguments. /// Check for unimplemented command line arguments.
/// ///
/// Either return the degenerate Ok value, or an Err with string. /// Either return the degenerate Ok value, or an Err with string.
@ -221,34 +248,35 @@ fn parse_opts(args: Vec<String>) -> getopts::Matches {
/// ///
/// Error datum is a string of the unimplemented argument. /// Error datum is a string of the unimplemented argument.
/// ///
fn check_unimplemented(matches: &getopts::Matches) -> Result<(), &str> { ///
if matches.opt_present("backup") { fn check_unimplemented<'a>(matches: &ArgMatches) -> Result<(), &'a str> {
if matches.is_present(OPT_BACKUP) {
Err("--backup") Err("--backup")
} else if matches.opt_present("b") { } else if matches.is_present(OPT_BACKUP_2) {
Err("-b") Err("-b")
} else if matches.opt_present("compare") { } else if matches.is_present(OPT_COMPARE) {
Err("--compare, -C") Err("--compare, -C")
} else if matches.opt_present("D") { } else if matches.is_present(OPT_CREATED) {
Err("-D") Err("-D")
} else if matches.opt_present("group") { } else if matches.is_present(OPT_GROUP) {
Err("--group, -g") Err("--group, -g")
} else if matches.opt_present("owner") { } else if matches.is_present(OPT_OWNER) {
Err("--owner, -o") Err("--owner, -o")
} else if matches.opt_present("preserve-timestamps") { } else if matches.is_present(OPT_PRESERVE_TIMESTAMPS) {
Err("--preserve-timestamps, -p") Err("--preserve-timestamps, -p")
} else if matches.opt_present("strip") { } else if matches.is_present(OPT_STRIP) {
Err("--strip, -s") Err("--strip, -s")
} else if matches.opt_present("strip-program") { } else if matches.is_present(OPT_STRIP_PROGRAM) {
Err("--strip-program") Err("--strip-program")
} else if matches.opt_present("suffix") { } else if matches.is_present(OPT_SUFFIX) {
Err("--suffix, -S") Err("--suffix, -S")
} else if matches.opt_present("target-directory") { } else if matches.is_present(OPT_TARGET_DIRECTORY) {
Err("--target-directory, -t") Err("--target-directory, -t")
} else if matches.opt_present("no-target-directory") { } else if matches.is_present(OPT_NO_TARGET_DIRECTORY) {
Err("--no-target-directory, -T") Err("--no-target-directory, -T")
} else if matches.opt_present("preserve-context") { } else if matches.is_present(OPT_PRESERVE_CONTEXT) {
Err("--preserve-context, -P") Err("--preserve-context, -P")
} else if matches.opt_present("context") { } else if matches.is_present(OPT_CONTEXT) {
Err("--context, -Z") Err("--context, -Z")
} else { } else {
Ok(()) Ok(())
@ -263,8 +291,8 @@ fn check_unimplemented(matches: &getopts::Matches) -> Result<(), &str> {
/// ///
/// In event of failure, returns an integer intended as a program return code. /// In event of failure, returns an integer intended as a program return code.
/// ///
fn behavior(matches: &getopts::Matches) -> Result<Behavior, i32> { fn behavior(matches: &ArgMatches) -> Result<Behavior, i32> {
let main_function = if matches.opt_present("directory") { let main_function = if matches.is_present("directory") {
MainFunction::Directory MainFunction::Directory
} else { } else {
MainFunction::Standard MainFunction::Standard
@ -272,8 +300,8 @@ fn behavior(matches: &getopts::Matches) -> Result<Behavior, i32> {
let considering_dir: bool = MainFunction::Directory == main_function; let considering_dir: bool = MainFunction::Directory == main_function;
let specified_mode: Option<u32> = if matches.opt_present("mode") { let specified_mode: Option<u32> = if matches.is_present(OPT_MODE) {
match matches.opt_str("mode") { match matches.value_of(OPT_MODE) {
Some(x) => match mode::parse(&x[..], considering_dir) { Some(x) => match mode::parse(&x[..], considering_dir) {
Ok(y) => Some(y), Ok(y) => Some(y),
Err(err) => { Err(err) => {
@ -285,7 +313,7 @@ fn behavior(matches: &getopts::Matches) -> Result<Behavior, i32> {
show_error!( show_error!(
"option '--mode' requires an argument\n \ "option '--mode' requires an argument\n \
Try '{} --help' for more information.", Try '{} --help' for more information.",
NAME executable!()
); );
return Err(1); return Err(1);
} }
@ -294,27 +322,27 @@ fn behavior(matches: &getopts::Matches) -> Result<Behavior, i32> {
None None
}; };
let backup_suffix = if matches.opt_present("suffix") { let backup_suffix = if matches.is_present(OPT_SUFFIX) {
match matches.opt_str("suffix") { match matches.value_of(OPT_SUFFIX) {
Some(x) => x, Some(x) => x,
None => { None => {
show_error!( show_error!(
"option '--suffix' requires an argument\n\ "option '--suffix' requires an argument\n\
Try '{} --help' for more information.", Try '{} --help' for more information.",
NAME executable!()
); );
return Err(1); return Err(1);
} }
} }
} else { } else {
"~".to_owned() "~"
}; };
Ok(Behavior { Ok(Behavior {
main_function, main_function,
specified_mode, specified_mode,
suffix: backup_suffix, suffix: backup_suffix.to_string(),
verbose: matches.opt_present("v"), verbose: matches.is_present(OPT_VERBOSE),
}) })
} }
@ -325,15 +353,15 @@ fn behavior(matches: &getopts::Matches) -> Result<Behavior, i32> {
/// ///
/// Returns an integer intended as a program return code. /// Returns an integer intended as a program return code.
/// ///
fn directory(paths: &[PathBuf], b: Behavior) -> i32 { fn directory(paths: Vec<String>, b: Behavior) -> i32 {
if paths.is_empty() { if paths.is_empty() {
println!("{} with -d requires at least one argument.", NAME); println!("{} with -d requires at least one argument.", executable!());
1 1
} else { } else {
let mut all_successful = true; let mut all_successful = true;
for directory in paths.iter() { for directory in paths.iter() {
let path = directory.as_path(); let path = Path::new(directory);
if path.exists() { if path.exists() {
show_info!("cannot create directory '{}': File exists", path.display()); show_info!("cannot create directory '{}': File exists", path.display());
@ -371,18 +399,21 @@ fn is_new_file_path(path: &Path) -> bool {
/// ///
/// Returns an integer intended as a program return code. /// Returns an integer intended as a program return code.
/// ///
fn standard(paths: &[PathBuf], b: Behavior) -> i32 { fn standard(paths: Vec<String>, b: Behavior) -> i32 {
if paths.len() < 2 { if paths.len() < 2 {
println!("{} requires at least 2 arguments.", NAME); println!("{} requires at least 2 arguments.", executable!());
1 1
} else { } else {
let sources = &paths[0..paths.len() - 1]; let sources = &paths[0..paths.len() - 1]
let target = &paths[paths.len() - 1]; .iter()
.map(PathBuf::from)
.collect::<Vec<_>>();
let target = Path::new(paths.last().unwrap());
if (target.is_file() || is_new_file_path(target)) && sources.len() == 1 { if (target.is_file() || is_new_file_path(target)) && sources.len() == 1 {
copy_file_to_file(&sources[0], target, &b) copy_file_to_file(&sources[0], &target.to_path_buf(), &b)
} else { } else {
copy_files_into_dir(sources, target, &b) copy_files_into_dir(sources, &target.to_path_buf(), &b)
} }
} }
} }

View file

@ -16,8 +16,8 @@ path = "src/join.rs"
[dependencies] [dependencies]
clap = "2.32" clap = "2.32"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "join" name = "join"

View file

@ -16,8 +16,8 @@ path = "src/kill.rs"
[dependencies] [dependencies]
libc = "0.2.42" libc = "0.2.42"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features=["signals"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features=["signals"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "kill" name = "kill"

View file

@ -16,8 +16,8 @@ path = "src/link.rs"
[dependencies] [dependencies]
libc = "0.2.42" libc = "0.2.42"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "link" name = "link"

View file

@ -16,8 +16,8 @@ path = "src/ln.rs"
[dependencies] [dependencies]
libc = "0.2.42" libc = "0.2.42"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "ln" name = "ln"

View file

@ -16,8 +16,8 @@ path = "src/logname.rs"
[dependencies] [dependencies]
libc = "0.2.42" libc = "0.2.42"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "logname" name = "logname"

View file

@ -23,8 +23,8 @@ term_grid = "0.1.5"
termsize = "0.1.6" termsize = "0.1.6"
time = "0.1.40" time = "0.1.40"
unicode-width = "0.1.5" unicode-width = "0.1.5"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features=["entries", "fs"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features=["entries", "fs"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "ls" name = "ls"

View file

@ -15,10 +15,10 @@ edition = "2018"
path = "src/mkdir.rs" path = "src/mkdir.rs"
[dependencies] [dependencies]
getopts = "0.2.18" clap = "2.33"
libc = "0.2.42" libc = "0.2.42"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features=["fs", "mode"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features=["fs", "mode"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "mkdir" name = "mkdir"

View file

@ -5,53 +5,78 @@
// * 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.
extern crate getopts; extern crate clap;
#[macro_use] #[macro_use]
extern crate uucore; extern crate uucore;
use clap::{App, Arg};
use std::fs; use std::fs;
use std::path::Path; use std::path::Path;
static NAME: &str = "mkdir"; static ABOUT: &str = "Create the given DIRECTORY(ies) if they do not exist";
static VERSION: &str = env!("CARGO_PKG_VERSION"); static VERSION: &str = env!("CARGO_PKG_VERSION");
static OPT_MODE: &str = "mode";
static OPT_PARENTS: &str = "parents";
static OPT_VERBOSE: &str = "verbose";
static ARG_DIRS: &str = "dirs";
fn get_usage() -> String {
format!("{0} [OPTION]... [USER]", executable!())
}
/** /**
* Handles option parsing * Handles option parsing
*/ */
pub fn uumain(args: impl uucore::Args) -> i32 { pub fn uumain(args: impl uucore::Args) -> i32 {
let args = args.collect_str(); let usage = get_usage();
let mut opts = getopts::Options::new();
// Linux-specific options, not implemented // Linux-specific options, not implemented
// opts.optflag("Z", "context", "set SELinux security context" + // opts.optflag("Z", "context", "set SELinux security context" +
// " of each created directory to CTX"), // " of each created directory to CTX"),
opts.optopt("m", "mode", "set file mode", "755"); let matches = App::new(executable!())
opts.optflag("p", "parents", "make parent directories as needed"); .version(VERSION)
opts.optflag("v", "verbose", "print a message for each printed directory"); .about(ABOUT)
opts.optflag("h", "help", "display this help"); .usage(&usage[..])
opts.optflag("V", "version", "display this version"); .arg(
Arg::with_name(OPT_MODE)
.short("m")
.long(OPT_MODE)
.help("set file mode")
.default_value("755"),
)
.arg(
Arg::with_name(OPT_PARENTS)
.short("p")
.long(OPT_PARENTS)
.help("make parent directories as needed"),
)
.arg(
Arg::with_name(OPT_VERBOSE)
.short("v")
.long(OPT_VERBOSE)
.help("print a message for each printed directory"),
)
.arg(
Arg::with_name(ARG_DIRS)
.multiple(true)
.takes_value(true)
.min_values(1),
)
.get_matches_from(args);
let matches = match opts.parse(&args[1..]) { let dirs: Vec<String> = matches
Ok(m) => m, .values_of(ARG_DIRS)
Err(f) => crash!(1, "Invalid options\n{}", f), .map(|v| v.map(ToString::to_string).collect())
}; .unwrap_or_default();
if args.len() == 1 || matches.opt_present("help") { let verbose = matches.is_present(OPT_VERBOSE);
print_help(&opts); let recursive = matches.is_present(OPT_PARENTS);
return 0;
}
if matches.opt_present("version") {
println!("{} {}", NAME, VERSION);
return 0;
}
let verbose = matches.opt_present("verbose");
let recursive = matches.opt_present("parents");
// Translate a ~str in octal form to u16, default to 755 // Translate a ~str in octal form to u16, default to 755
// Not tested on Windows // Not tested on Windows
let mode_match = matches.opts_str(&["mode".to_owned()]); let mode_match = matches.value_of(OPT_MODE);
let mode: u16 = match mode_match { let mode: u16 = match mode_match {
Some(m) => { Some(m) => {
let res: Option<u16> = u16::from_str_radix(&m, 8).ok(); let res: Option<u16> = u16::from_str_radix(&m, 8).ok();
@ -63,23 +88,9 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
_ => 0o755 as u16, _ => 0o755 as u16,
}; };
let dirs = matches.free;
if dirs.is_empty() {
crash!(1, "missing operand");
}
exec(dirs, recursive, mode, verbose) exec(dirs, recursive, mode, verbose)
} }
fn print_help(opts: &getopts::Options) {
println!("{} {}", NAME, VERSION);
println!();
println!("Usage:");
print!(
"{}",
opts.usage("Create the given DIRECTORY(ies) if they do not exist")
);
}
/** /**
* Create the list of new directories * Create the list of new directories
*/ */
@ -120,7 +131,7 @@ fn mkdir(path: &Path, recursive: bool, mode: u16, verbose: bool) -> i32 {
} }
if verbose { if verbose {
show_info!("created directory '{}'", path.display()); println!("{}: created directory '{}'", executable!(), path.display());
} }
#[cfg(any(unix, target_os = "redox"))] #[cfg(any(unix, target_os = "redox"))]

View file

@ -17,8 +17,8 @@ path = "src/mkfifo.rs"
[dependencies] [dependencies]
getopts = "0.2.18" getopts = "0.2.18"
libc = "0.2.42" libc = "0.2.42"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "mkfifo" name = "mkfifo"

View file

@ -18,8 +18,8 @@ path = "src/mknod.rs"
[dependencies] [dependencies]
getopts = "0.2.18" getopts = "0.2.18"
libc = "^0.2.42" libc = "^0.2.42"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features=["mode"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features=["mode"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "mknod" name = "mknod"

View file

@ -18,8 +18,8 @@ path = "src/mktemp.rs"
getopts = "0.2.18" getopts = "0.2.18"
rand = "0.5" rand = "0.5"
tempfile = "3.0" tempfile = "3.0"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "mktemp" name = "mktemp"

View file

@ -16,8 +16,8 @@ path = "src/more.rs"
[dependencies] [dependencies]
getopts = "0.2.18" getopts = "0.2.18"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[target.'cfg(target_os = "redox")'.dependencies] [target.'cfg(target_os = "redox")'.dependencies]
redox_termios = "0.1" redox_termios = "0.1"

View file

@ -17,8 +17,8 @@ path = "src/mv.rs"
[dependencies] [dependencies]
getopts = "0.2.18" getopts = "0.2.18"
fs_extra = "1.1.0" fs_extra = "1.1.0"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "mv" name = "mv"

View file

@ -17,8 +17,8 @@ path = "src/nice.rs"
[dependencies] [dependencies]
getopts = "0.2.18" getopts = "0.2.18"
libc = "0.2.42" libc = "0.2.42"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "nice" name = "nice"

View file

@ -21,8 +21,8 @@ libc = "0.2.42"
memchr = "2.2.0" memchr = "2.2.0"
regex = "1.0.1" regex = "1.0.1"
regex-syntax = "0.6.7" regex-syntax = "0.6.7"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "nl" name = "nl"

View file

@ -17,8 +17,8 @@ path = "src/nohup.rs"
[dependencies] [dependencies]
getopts = "0.2.18" getopts = "0.2.18"
libc = "0.2.42" libc = "0.2.42"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features=["fs"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features=["fs"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "nohup" name = "nohup"

View file

@ -18,8 +18,8 @@ path = "src/nproc.rs"
libc = "0.2.42" libc = "0.2.42"
num_cpus = "1.10" num_cpus = "1.10"
clap = "2.33" clap = "2.33"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features=["fs"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features=["fs"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "nproc" name = "nproc"

View file

@ -16,8 +16,8 @@ path = "src/numfmt.rs"
[dependencies] [dependencies]
getopts = "0.2.18" getopts = "0.2.18"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "numfmt" name = "numfmt"

View file

@ -19,8 +19,8 @@ byteorder = "1.3.2"
getopts = "0.2.18" getopts = "0.2.18"
half = "1.6" half = "1.6"
libc = "0.2.42" libc = "0.2.42"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "od" name = "od"

View file

@ -16,8 +16,8 @@ path = "src/paste.rs"
[dependencies] [dependencies]
getopts = "0.2.18" getopts = "0.2.18"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "paste" name = "paste"

View file

@ -17,8 +17,8 @@ path = "src/pathchk.rs"
[dependencies] [dependencies]
getopts = "0.2.18" getopts = "0.2.18"
libc = "0.2.42" libc = "0.2.42"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "pathchk" name = "pathchk"

View file

@ -15,8 +15,8 @@ edition = "2018"
path = "src/pinky.rs" path = "src/pinky.rs"
[dependencies] [dependencies]
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features=["utmpx", "entries"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features=["utmpx", "entries"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "pinky" name = "pinky"

View file

@ -16,8 +16,8 @@ path = "src/printenv.rs"
[dependencies] [dependencies]
clap = "2.33" clap = "2.33"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "printenv" name = "printenv"

View file

@ -19,8 +19,8 @@ path = "src/printf.rs"
[dependencies] [dependencies]
itertools = "0.8.0" itertools = "0.8.0"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "printf" name = "printf"

View file

@ -21,8 +21,8 @@ libc = "0.2.42"
memchr = "2.2.0" memchr = "2.2.0"
regex = "1.0.1" regex = "1.0.1"
regex-syntax = "0.6.7" regex-syntax = "0.6.7"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "ptx" name = "ptx"

View file

@ -16,8 +16,8 @@ path = "src/pwd.rs"
[dependencies] [dependencies]
clap = "2.33" clap = "2.33"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "pwd" name = "pwd"

View file

@ -17,8 +17,8 @@ path = "src/readlink.rs"
[dependencies] [dependencies]
clap = "2.33" clap = "2.33"
libc = "0.2.42" libc = "0.2.42"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features=["fs"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features=["fs"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "readlink" name = "readlink"

View file

@ -16,8 +16,8 @@ path = "src/realpath.rs"
[dependencies] [dependencies]
getopts = "0.2.18" getopts = "0.2.18"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features=["fs"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features=["fs"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "realpath" name = "realpath"

View file

@ -16,8 +16,8 @@ path = "src/relpath.rs"
[dependencies] [dependencies]
getopts = "0.2.18" getopts = "0.2.18"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features=["fs"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features=["fs"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "relpath" name = "relpath"

View file

@ -15,11 +15,11 @@ edition = "2018"
path = "src/rm.rs" path = "src/rm.rs"
[dependencies] [dependencies]
getopts = "0.2.18" clap = "2.33"
walkdir = "2.2.8" walkdir = "2.2.8"
remove_dir_all = "0.5.1" remove_dir_all = "0.5.1"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "rm" name = "rm"

View file

@ -7,13 +7,14 @@
// spell-checker:ignore (ToDO) bitor ulong // spell-checker:ignore (ToDO) bitor ulong
extern crate getopts; extern crate clap;
extern crate remove_dir_all; extern crate remove_dir_all;
extern crate walkdir; extern crate walkdir;
#[macro_use] #[macro_use]
extern crate uucore; extern crate uucore;
use clap::{App, Arg};
use remove_dir_all::remove_dir_all; use remove_dir_all::remove_dir_all;
use std::collections::VecDeque; use std::collections::VecDeque;
use std::fs; use std::fs;
@ -40,83 +41,139 @@ struct Options {
verbose: bool, verbose: bool,
} }
static NAME: &str = "rm"; static ABOUT: &str = "Remove (unlink) the FILE(s)";
static VERSION: &str = env!("CARGO_PKG_VERSION"); static VERSION: &str = env!("CARGO_PKG_VERSION");
static OPT_DIR: &str = "dir";
static OPT_INTERACTIVE: &str = "interactive";
static OPT_FORCE: &str = "force";
static OPT_NO_PRESERVE_ROOT: &str = "no-preserve-root";
static OPT_ONE_FILE_SYSTEM: &str = "one-file-system";
static OPT_PRESERVE_ROOT: &str = "preserve-root";
static OPT_PROMPT: &str = "prompt";
static OPT_PROMPT_MORE: &str = "prompt-more";
static OPT_RECURSIVE: &str = "recursive";
static OPT_VERBOSE: &str = "verbose";
static ARG_FILES: &str = "files";
fn get_usage() -> String {
format!("{0} [OPTION]... FILE...", executable!())
}
fn get_long_usage() -> String {
String::from(
"By default, rm does not remove directories. Use the --recursive (-r)
option to remove each listed directory, too, along with all of its contents
To remove a file whose name starts with a '-', for example '-foo',
use one of these commands:
rm -- -foo
rm ./-foo
Note that if you use rm to remove a file, it might be possible to recover
some of its contents, given sufficient expertise and/or time. For greater
assurance that the contents are truly unrecoverable, consider using shred.",
)
}
pub fn uumain(args: impl uucore::Args) -> i32 { pub fn uumain(args: impl uucore::Args) -> i32 {
let args = args.collect_str(); let usage = get_usage();
let long_usage = get_long_usage();
let matches = App::new(executable!())
.version(VERSION)
.about(ABOUT)
.usage(&usage[..])
.after_help(&long_usage[..])
// TODO: make getopts support -R in addition to -r // TODO: make getopts support -R in addition to -r
let mut opts = getopts::Options::new();
opts.optflag( .arg(
"f", Arg::with_name(OPT_FORCE)
"force", .short("f")
"ignore nonexistent files and arguments, never prompt", .long(OPT_FORCE)
); .help("ignore nonexistent files and arguments, never prompt")
opts.optflag("i", "", "prompt before every removal"); )
opts.optflag("I", "", "prompt once before removing more than three files, or when removing recursively. Less intrusive than -i, while still giving some protection against most mistakes"); .arg(
opts.optflagopt( Arg::with_name(OPT_PROMPT)
"", .short("i")
"interactive", .long("prompt before every removal")
"prompt according to WHEN: never, once (-I), or always (-i). Without WHEN, prompts always", )
"WHEN", .arg(
); Arg::with_name(OPT_PROMPT_MORE)
opts.optflag("", "one-file-system", "when removing a hierarchy recursively, skip any directory that is on a file system different from that of the corresponding command line argument (NOT IMPLEMENTED)"); .short("I")
opts.optflag("", "no-preserve-root", "do not treat '/' specially"); .help("prompt once before removing more than three files, or when removing recursively. Less intrusive than -i, while still giving some protection against most mistakes")
opts.optflag("", "preserve-root", "do not remove '/' (default)"); )
opts.optflag( .arg(
"r", Arg::with_name(OPT_INTERACTIVE)
"recursive", .long(OPT_INTERACTIVE)
"remove directories and their contents recursively", .help("prompt according to WHEN: never, once (-I), or always (-i). Without WHEN, prompts always")
); .value_name("WHEN")
opts.optflag("d", "dir", "remove empty directories"); .takes_value(true)
opts.optflag("v", "verbose", "explain what is being done"); )
opts.optflag("h", "help", "display this help and exit"); .arg(
opts.optflag("V", "version", "output version information and exit"); Arg::with_name(OPT_ONE_FILE_SYSTEM)
.long(OPT_ONE_FILE_SYSTEM)
.help("when removing a hierarchy recursively, skip any directory that is on a file system different from that of the corresponding command line argument (NOT IMPLEMENTED)")
)
.arg(
Arg::with_name(OPT_NO_PRESERVE_ROOT)
.long(OPT_NO_PRESERVE_ROOT)
.help("do not treat '/' specially")
)
.arg(
Arg::with_name(OPT_PRESERVE_ROOT)
.long(OPT_PRESERVE_ROOT)
.help("do not remove '/' (default)")
)
.arg(
Arg::with_name(OPT_RECURSIVE).short("r")
.long(OPT_RECURSIVE)
.help("remove directories and their contents recursively")
)
.arg(
Arg::with_name(OPT_DIR)
.short("d")
.long(OPT_DIR)
.help("remove empty directories")
)
.arg(
Arg::with_name(OPT_VERBOSE)
.short("v")
.long(OPT_VERBOSE)
.help("explain what is being done")
)
.arg(
Arg::with_name(ARG_FILES)
.multiple(true)
.takes_value(true)
.min_values(1)
)
.get_matches_from(args);
let matches = match opts.parse(&args[1..]) { let files: Vec<String> = matches
Ok(m) => m, .values_of(ARG_FILES)
Err(f) => crash!(1, "{}", f), .map(|v| v.map(ToString::to_string).collect())
}; .unwrap_or_default();
let force = matches.opt_present("force"); let force = matches.is_present(OPT_FORCE);
if matches.opt_present("help") { if files.is_empty() && !force {
println!("{} {}", NAME, VERSION); // Still check by hand and not use clap
println!(); // Because "rm -f" is a thing
println!("Usage:");
println!(" {0} [OPTION]... [FILE]...", NAME);
println!();
println!("{}", opts.usage("Remove (unlink) the FILE(s)."));
println!("By default, rm does not remove directories. Use the --recursive (-r)");
println!("option to remove each listed directory, too, along with all of its contents");
println!();
println!("To remove a file whose name starts with a '-', for example '-foo',");
println!("use one of these commands:");
println!("rm -- -foo");
println!();
println!("rm ./-foo");
println!();
println!("Note that if you use rm to remove a file, it might be possible to recover");
println!("some of its contents, given sufficient expertise and/or time. For greater");
println!("assurance that the contents are truly unrecoverable, consider using shred.");
} else if matches.opt_present("version") {
println!("{} {}", NAME, VERSION);
} else if matches.free.is_empty() && !force {
show_error!("missing an argument"); show_error!("missing an argument");
show_error!("for help, try '{0} --help'", NAME); show_error!("for help, try '{0} --help'", executable!());
return 1; return 1;
} else { } else {
let options = Options { let options = Options {
force, force,
interactive: { interactive: {
if matches.opt_present("i") { if matches.is_present(OPT_PROMPT) {
InteractiveMode::Always InteractiveMode::Always
} else if matches.opt_present("I") { } else if matches.is_present(OPT_PROMPT_MORE) {
InteractiveMode::Once InteractiveMode::Once
} else if matches.opt_present("interactive") { } else if matches.is_present(OPT_INTERACTIVE) {
match &matches.opt_str("interactive").unwrap()[..] { match &matches.value_of(OPT_INTERACTIVE).unwrap()[..] {
"none" => InteractiveMode::None, "none" => InteractiveMode::None,
"once" => InteractiveMode::Once, "once" => InteractiveMode::Once,
"always" => InteractiveMode::Always, "always" => InteractiveMode::Always,
@ -126,15 +183,13 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
InteractiveMode::None InteractiveMode::None
} }
}, },
one_fs: matches.opt_present("one-file-system"), one_fs: matches.is_present(OPT_ONE_FILE_SYSTEM),
preserve_root: !matches.opt_present("no-preserve-root"), preserve_root: !matches.is_present(OPT_NO_PRESERVE_ROOT),
recursive: matches.opt_present("recursive"), recursive: matches.is_present(OPT_RECURSIVE),
dir: matches.opt_present("dir"), dir: matches.is_present(OPT_DIR),
verbose: matches.opt_present("verbose"), verbose: matches.is_present(OPT_VERBOSE),
}; };
if options.interactive == InteractiveMode::Once if options.interactive == InteractiveMode::Once && (options.recursive || files.len() > 3) {
&& (options.recursive || matches.free.len() > 3)
{
let msg = if options.recursive { let msg = if options.recursive {
"Remove all arguments recursively? " "Remove all arguments recursively? "
} else { } else {
@ -145,7 +200,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
} }
} }
if remove(matches.free, options) { if remove(files, options) {
return 1; return 1;
} }
} }

View file

@ -16,8 +16,8 @@ path = "src/rmdir.rs"
[dependencies] [dependencies]
clap = "2.33" clap = "2.33"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "rmdir" name = "rmdir"

View file

@ -16,8 +16,8 @@ path = "src/seq.rs"
[dependencies] [dependencies]
clap = "2.33" clap = "2.33"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "seq" name = "seq"

View file

@ -20,8 +20,8 @@ getopts = "0.2.18"
libc = "0.2.42" libc = "0.2.42"
rand = "0.5" rand = "0.5"
time = "0.1.40" time = "0.1.40"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "shred" name = "shred"

View file

@ -17,8 +17,8 @@ path = "src/shuf.rs"
[dependencies] [dependencies]
getopts = "0.2.18" getopts = "0.2.18"
rand = "0.5" rand = "0.5"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "shuf" name = "shuf"

View file

@ -16,8 +16,8 @@ path = "src/sleep.rs"
[dependencies] [dependencies]
getopts = "0.2.18" getopts = "0.2.18"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features=["parse_time"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features=["parse_time"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "sleep" name = "sleep"

View file

@ -18,8 +18,8 @@ path = "src/sort.rs"
clap = "2.33" clap = "2.33"
itertools = "0.8.0" itertools = "0.8.0"
semver = "0.9.0" semver = "0.9.0"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features=["fs"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features=["fs"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "sort" name = "sort"

View file

@ -16,8 +16,8 @@ path = "src/split.rs"
[dependencies] [dependencies]
getopts = "0.2.18" getopts = "0.2.18"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "split" name = "split"

View file

@ -17,8 +17,8 @@ path = "src/stat.rs"
[dependencies] [dependencies]
clap = "2.33" clap = "2.33"
time = "0.1.40" time = "0.1.40"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features=["entries", "libc"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features=["entries", "libc"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "stat" name = "stat"

View file

@ -17,8 +17,8 @@ path = "src/stdbuf.rs"
[dependencies] [dependencies]
getopts = "0.2.18" getopts = "0.2.18"
tempfile = "3.1" tempfile = "3.1"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[build-dependencies] [build-dependencies]
libstdbuf = { version="0.0.1", package="uu_stdbuf_libstdbuf", path="src/libstdbuf" } libstdbuf = { version="0.0.1", package="uu_stdbuf_libstdbuf", path="src/libstdbuf" }

View file

@ -19,8 +19,8 @@ crate-type = ["cdylib", "rlib"] # XXX: note: the rlib is just to prevent Cargo f
[dependencies] [dependencies]
cpp = "0.4" cpp = "0.4"
libc = "0.2" libc = "0.2"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../../../uucore_procs" }
[build-dependencies] [build-dependencies]
cpp_build = "0.4" cpp_build = "0.4"

View file

@ -16,8 +16,8 @@ path = "src/sum.rs"
[dependencies] [dependencies]
getopts = "0.2.18" getopts = "0.2.18"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "sum" name = "sum"

View file

@ -15,10 +15,10 @@ edition = "2018"
path = "src/sync.rs" path = "src/sync.rs"
[dependencies] [dependencies]
getopts = "0.2.18" clap = "2.33"
libc = "0.2.42" libc = "0.2.42"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features=["wide"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features=["wide"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
winapi = { version = "0.3", features = ["errhandlingapi", "fileapi", "handleapi", "std", "winbase", "winerror"] } winapi = { version = "0.3", features = ["errhandlingapi", "fileapi", "handleapi", "std", "winbase", "winerror"] }
[[bin]] [[bin]]

View file

@ -7,17 +7,14 @@
/* Last synced with: sync (GNU coreutils) 8.13 */ /* Last synced with: sync (GNU coreutils) 8.13 */
extern crate getopts; extern crate clap;
extern crate libc; extern crate libc;
#[cfg(windows)]
#[macro_use] #[macro_use]
extern crate uucore; extern crate uucore;
#[cfg(not(windows))] use clap::App;
extern crate uucore; static ABOUT: &str = "Synchronize cached writes to persistent storage";
static NAME: &str = "sync";
static VERSION: &str = env!("CARGO_PKG_VERSION"); static VERSION: &str = env!("CARGO_PKG_VERSION");
#[cfg(unix)] #[cfg(unix)]
@ -118,57 +115,23 @@ mod platform {
} }
} }
fn get_usage() -> String {
format!("{0} [OPTION]... FILE...", executable!())
}
pub fn uumain(args: impl uucore::Args) -> i32 { pub fn uumain(args: impl uucore::Args) -> i32 {
let args = args.collect_str(); let usage = get_usage();
let mut opts = getopts::Options::new(); let _matches = App::new(executable!())
.version(VERSION)
opts.optflag("h", "help", "display this help and exit"); .about(ABOUT)
opts.optflag("V", "version", "output version information and exit"); .usage(&usage[..])
.get_matches_from(args);
let matches = match opts.parse(&args[1..]) {
Ok(m) => m,
_ => {
help(&opts);
return 1;
}
};
if matches.opt_present("h") {
help(&opts);
return 0;
}
if matches.opt_present("V") {
version();
return 0;
}
sync(); sync();
0 0
} }
fn version() {
println!("{} (uutils) {}", NAME, VERSION);
println!("The MIT License");
println!();
println!("Author -- Alexander Fomin.");
}
fn help(opts: &getopts::Options) {
let msg = format!(
"{0} {1}
Usage:
{0} [OPTION]
Force changed blocks to disk, update the super block.",
NAME, VERSION
);
print!("{}", opts.usage(&msg));
}
fn sync() -> isize { fn sync() -> isize {
unsafe { platform::do_sync() } unsafe { platform::do_sync() }
} }

View file

@ -16,8 +16,8 @@ path = "src/tac.rs"
[dependencies] [dependencies]
getopts = "0.2.18" getopts = "0.2.18"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "tac" name = "tac"

View file

@ -17,8 +17,8 @@ path = "src/tail.rs"
[dependencies] [dependencies]
getopts = "0.2.18" getopts = "0.2.18"
libc = "0.2.42" libc = "0.2.42"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
winapi = { version="0.3", features=["fileapi", "handleapi", "processthreadsapi", "synchapi", "winbase"] } winapi = { version="0.3", features=["fileapi", "handleapi", "processthreadsapi", "synchapi", "winbase"] }
[target.'cfg(target_os = "redox")'.dependencies] [target.'cfg(target_os = "redox")'.dependencies]

View file

@ -17,8 +17,8 @@ path = "src/tee.rs"
[dependencies] [dependencies]
getopts = "0.2.18" getopts = "0.2.18"
libc = "0.2.42" libc = "0.2.42"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "tee" name = "tee"

View file

@ -16,8 +16,8 @@ path = "src/test.rs"
[dependencies] [dependencies]
libc = "0.2.42" libc = "0.2.42"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[target.'cfg(target_os = "redox")'.dependencies] [target.'cfg(target_os = "redox")'.dependencies]
redox_syscall = "0.1" redox_syscall = "0.1"

View file

@ -18,8 +18,8 @@ path = "src/timeout.rs"
getopts = "0.2.18" getopts = "0.2.18"
libc = "0.2.42" libc = "0.2.42"
time = "0.1.40" time = "0.1.40"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features=["parse_time", "process", "signals"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features=["parse_time", "process", "signals"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "timeout" name = "timeout"

View file

@ -18,8 +18,8 @@ path = "src/touch.rs"
filetime = "0.2.1" filetime = "0.2.1"
getopts = "0.2.18" getopts = "0.2.18"
time = "0.1.40" time = "0.1.40"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features=["libc"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features=["libc"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "touch" name = "touch"

View file

@ -18,8 +18,8 @@ path = "src/tr.rs"
bit-set = "0.5.0" bit-set = "0.5.0"
fnv = "1.0.5" fnv = "1.0.5"
getopts = "0.2.18" getopts = "0.2.18"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "tr" name = "tr"

View file

@ -15,8 +15,8 @@ edition = "2018"
path = "src/true.rs" path = "src/true.rs"
[dependencies] [dependencies]
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "true" name = "true"

View file

@ -16,8 +16,8 @@ path = "src/truncate.rs"
[dependencies] [dependencies]
clap = "2.33" clap = "2.33"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "truncate" name = "truncate"

View file

@ -16,8 +16,8 @@ path = "src/tsort.rs"
[dependencies] [dependencies]
getopts = "0.2.18" getopts = "0.2.18"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "tsort" name = "tsort"

View file

@ -17,8 +17,8 @@ path = "src/tty.rs"
[dependencies] [dependencies]
getopts = "0.2.18" getopts = "0.2.18"
libc = "0.2.42" libc = "0.2.42"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features=["fs"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features=["fs"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "tty" name = "tty"

View file

@ -17,8 +17,8 @@ path = "src/uname.rs"
[dependencies] [dependencies]
clap = "2.32" clap = "2.32"
platform-info = "0.0.1" platform-info = "0.0.1"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "uname" name = "uname"

View file

@ -17,8 +17,8 @@ path = "src/unexpand.rs"
[dependencies] [dependencies]
getopts = "0.2.18" getopts = "0.2.18"
unicode-width = "0.1.5" unicode-width = "0.1.5"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "unexpand" name = "unexpand"

View file

@ -16,8 +16,8 @@ path = "src/uniq.rs"
[dependencies] [dependencies]
getopts = "0.2.18" getopts = "0.2.18"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "uniq" name = "uniq"

View file

@ -17,8 +17,8 @@ path = "src/unlink.rs"
[dependencies] [dependencies]
getopts = "0.2.18" getopts = "0.2.18"
libc = "0.2.42" libc = "0.2.42"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary" } uucore = { version=">=0.0.4", package="uucore", path="../../uucore" }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "unlink" name = "unlink"

View file

@ -19,8 +19,8 @@ getopts = "0.2.18"
time = "0.1.40" time = "0.1.40"
chrono = "0.4" chrono = "0.4"
clap = "2.32" clap = "2.32"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features=["libc", "utmpx"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features=["libc", "utmpx"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "uptime" name = "uptime"

View file

@ -16,8 +16,8 @@ path = "src/users.rs"
[dependencies] [dependencies]
clap = "2.33" clap = "2.33"
uucore = { version="0.0.4", package="uucore", git="https://github.com/uutils/uucore.git", branch="canary", features=["utmpx"] } uucore = { version=">=0.0.4", package="uucore", path="../../uucore", features=["utmpx"] }
uucore_procs = { version="0.0.4", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" } uucore_procs = { version=">=0.0.4", package="uucore_procs", path="../../uucore_procs" }
[[bin]] [[bin]]
name = "users" name = "users"

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