Fixes seven compiler warnings in cp.rs:
- unused imports: `c_char`, `c_int`
-> removed
- value assigned to `inode` is never read
-> no more default value, immutable
- value assigned to `nlinks` is never read
-> no more default value, immutable
- unused variable: `src_path`
-> removed
- unused `std::result::Result` which must be used
-> only in error on unsupported platforms (Windows) which is
already handled with #[cfg(unix)]
- variable `preserve_context` is assigned to, but never used
-> removed
- value assigned to `preserve_context` is never read
-> see above, remove
I forgot that -v refers to "verbose" and not "version"
when making earlier changes. So I fixed that and for
good measure added the verbose flag anyway.
* Added flag -t/--target-directory
* No longer assumes that the source arguments are files in the CWD (in other words, can copy files from directories other than CWD)
For coreutils, there are two build artifacts:
1. multicall executable (each utility is a separate static library)
2. individual utilities (still separate library with main wrapper)
To avoid namespace collision, each utility crate is defined as
"uu_{CMD}". The end user only sees the original utility name. This
simplifies build.rs.
Also, the thin wrapper for the main() function is no longer contained in
the crate. It has been separated into a dedicated file. This was
necessary to work around Cargo's need for the crate name attribute to
match the name in the respective Cargo.toml.
Everything in src/common has been moved to src/uucore. This is defined
as a Cargo library, instead of directly included. This gives us
flexibility to make the library an external crate in the future.
Fixes#717.
Builds the uutils multicall binary containing all utils (except stdbuf)
by default. To only build a subset
`cargo --no-default-features --features <utils>`
can be used.
Whats missing is building the standalone binaries and a mechanism to
automatically disable the build of unix only utils on windows.
The method, fs::canonicalize(), is unstable and can't be used for stable
builds. We already have our own implementation of canonicalize(), which
supports more options than the Rust library implementation.
I switched over to the getopts crate on crates.io, instead of Rust's
private implementation. This will allow coreutils to build for Rust 1.0.
I'm splitting the updates into several commits for easier reviewing.