Commit graph

210 commits

Author SHA1 Message Date
Jan Scheer e53f4db33a Merge branch 'master' into id_selinux_context 2021-07-06 13:29:50 +02:00
Michael Debertol 2ebca384c6 all utils: enable wrap_help
This makes clap wrap the help text according to the terminal width,
which improves readability for terminal widths < 120 chars,
because clap defaults to a width of 120 chars without this feature.
2021-06-27 16:17:10 +02:00
Michael Debertol a9e79c72c7 uutils: enable shell completions
This adds a hidden `completion` subcommand to coreutils. When invoked with
`coreutils completion <utility> <shell>` a completion file will be printed
to stdout. When running `make install` those files will be created for all
utilities and copied to the appropriate locations.
`make install` will install completions for zsh, fish and bash; however,
clap also supports generating completions for powershell and elvish.

With this patch all utilities are required to have a publich uu_app function
that returns a clap::App in addition to the uumain function.
2021-06-25 21:23:45 +02:00
Jan Scheer f1d317147b id: add support for showing SELinux context (--context/-Z) 2021-06-20 13:44:41 +02:00
Terts Diepraam eaa93e9c27 numfmt: move to common core 2021-06-20 00:25:02 +02:00
Terts Diepraam be8e5f5f30 use the same spec for atty everywhere 2021-06-09 17:15:42 +02:00
Jan Scheer 26ad05cbb4 uucore: fix order of group IDs returned from entries::get_groups()
As discussed here: https://github.com/uutils/coreutils/pull/2361
the group IDs returned for GNU's 'group' and GNU's 'id --groups'
starts with the effective group ID.
This implements a wrapper for `entris::get_groups()` which mimics
GNU's behaviour.

* add tests for `id`
* add tests for `groups`
* fix `id --groups --real` to no longer ignore `--real`
2021-06-08 18:39:05 +02:00
Michael Debertol e5c4681e04 tests: add the ability to set resource limits 2021-06-02 19:21:12 +02:00
Terts Diepraam 7690dc018f Merge branch 'master' into pr 2021-05-31 15:23:06 +02:00
Sylvestre Ledru 8c5dcd0765
Merge branch 'master' into implement-more 2021-05-31 10:17:15 +02:00
Terts Diepraam bc1870c0a7 Merge branch 'master' into pr 2021-05-29 19:21:31 +02:00
Jan Scheer fb812ff9d0 Cargo.toml: remove factor_benches in order to be able to run clippy
linting for all targets
2021-05-29 14:29:46 +02:00
Terts Diepraam 1c2540a613 Add atty to dev-deps for more tests 2021-05-28 21:07:38 +02:00
Sylvestre Ledru 222bd81190
Merge pull request #2291 from tertsdiepraam/remove-tempdir
Replace `tempdir` with `tempfile`
2021-05-28 10:45:19 +02:00
Terts Diepraam ebe6341ae3 chore: replace tempdir with tempfile 2021-05-27 22:47:03 +02:00
Terts Diepraam 825476f573 Update tempfile 2021-05-27 20:25:24 +02:00
nicoo 00322b986b factor: Move benchmarks out-of-crate 2021-05-17 19:43:38 +02:00
Michael Debertol 2084c3ddf3 tests: show pretty diffs for assertion failures
- All assert_eq in tests/common/util.rs now print a pretty diff on test
failures.
- {stdout, stderr}_is_fixture now compare the expected output and the
fixture as Strings, which leads to more usable diffs.
2021-04-24 16:43:13 +02:00
Sylvestre Ledru 844e318a67
Merge branch 'master' into pr 2021-04-09 22:02:25 +02:00
Sylvestre Ledru f37284129e new release 0.0.6 to address the cat issue 2021-04-03 16:06:58 +02:00
Sylvestre Ledru ac031dffa4 new release 0.0.5 2021-04-03 10:30:07 +02:00
paulotten 090d29496a
Issue #1622 port du to windows (#1788)
* Issue #1622 port `du` to windows

* Attempt to support Rust 1.32

Old version was getting "attributes are not yet allowed on `if`
expressions" on Rust 1.32

* Less #[cfg]

* Less duplicate code.

I need the return and the semicolon after if otherwise the second #[cfg]
leads to unexpected token complilation error

* More accurate size on disk calculations for windows

* Expect the same output on windows as with WSL

* Better matches output from du on WSL

* In the absence of feedback I'm disabling these tests on Windows.
They require `ln`. Windows does not ship with this utility.

* Use the coreutils version of `ln` to test `du`

`fn ccmd` is courtesy of @Artoria2e5

* Look up inodes (file ids) on Windows

* One more #[cfg(windows)] to prevent unreachable statement warning on linux
2021-04-01 23:16:47 +02:00
Ricardo Iglesias 5f17719a59
Implemented --indicator-style flag on ls. (#1907)
* Implemented --indicator-style flag on ls.

* Rust fmt

* Grouped indicator_style args.

* Added tests for sockets and pipes.

Needed to modify util.rs to add support for pipes (aka FIFOs).

* Updated util.rs to remove FIFO operations on Windows

* Fixed slight error in specifying (not(windows))

* Fixed style violations and added indicator_style test for non-unix systems
2021-03-29 13:10:13 +02:00
Antonio Gurgel 35675fdfe7
install: implement -C / --compare (#1811)
* install: implement `-C` / `--compare`

GNU coreutils [1] checks the following: whether
- either file is nonexistent,
- there's a sticky bit or set[ug]id bit in play,
- either file isn't a regular file,
- the sizes of both files mismatch,
- the destination file's owner differs from intended, or
- the contents of both files mismatch.

[1] https://git.savannah.gnu.org/cgit/coreutils.git/tree/src/install.c?h=v8.32#n174

* Add test: non-regular files

* Forgot a #[test]

* Give up on non-regular file test

* `cargo fmt` install.rs
2021-03-27 09:18:47 +01:00
Max Semenik 62fe68850e pr: Fixes after rebasing
Only the minimum needed to:
* Make everything compile without warnings
* Move files according to the new project structure
* Make tests pass
2021-03-26 17:57:19 +03:00
tilakpatidar 2d58ea5f8b pr: print 56 lines of content with 5 blank trailer and header lines 2021-03-26 14:11:14 +03:00
Sylvestre Ledru f431f58dd8
Bump min rustc to 1.40 (#1909) 2021-03-25 15:28:47 -07:00
Neculai Balaban c6927d97c8
cp: add support for -x/--one-file-system (#1840) 2021-03-19 21:15:35 +01:00
Sylvestre Ledru 6ad8528b99 update of the uucore dep to 0.0.7 2021-03-07 11:29:38 +01:00
Sylvestre Ledru 6481c5a247 Prepare version 0.0.4 2021-03-07 11:29:38 +01:00
Sylvestre Ledru 72e090cd83 cargo: remove an old comment 2021-03-07 11:02:46 +01:00
Sylvestre Ledru 262b508b89 update the dep to uucore 0.0.6 2021-02-01 23:55:43 +01:00
Sylvestre Ledru dc53b9bbf3 Also pin thread_local to version 1.1.0 2021-02-01 23:32:55 +01:00
Sylvestre Ledru a807fc623a Update to version 0.0.3 2021-01-22 09:40:38 +01:00
Sylvestre Ledru e331186fee
unbreak build with rustc 1.32: force tempfile 3.1.0 (#1695) 2021-01-19 08:15:53 +01:00
Sylvestre Ledru b8e886ad1a bump the minimal version of uucore & uucore_procs 2021-01-10 18:27:20 +01:00
Sylvestre Ledru d9ae043a05
update of the version 0.0.1 => 0.0.2 (#1686) 2021-01-10 18:16:04 +01:00
Sylvestre Ledru 138e407071
pin byteorder, version 1.4 fails with Rust 1.32 (#1684) 2021-01-09 20:51:18 +01:00
Stéphane Campinas 89bf7a726e csplit: refresh of the previous PR 2020-12-28 17:21:29 +01:00
Sylvestre Ledru 91559698d0 Merge branch 'master' into merge.uucore 2020-11-15 10:05:52 -06:00
Sylvestre Ledru 1b9267644c pin cc version. 1.0.62 fails with rust 1.32 2020-11-09 09:53:17 +01:00
Roy Ivy III f30a0e3560 maint/deps ~ pin 'cc' crate (avoids forced MinSRV update) 2020-11-08 20:26:46 -06:00
Roy Ivy III 6539b8c6b9 maint/deps ~ change version specification for dependencies between sub-packages
- refactor internal version specifications to be ">=M.m.p" (where M.m.p is *already published*)

## [why]

Loosening internal version dependencies decreases the coupling between packages such
that packages can be published in a looser order. It allows the packages to be version
updated and published in tandem (ie, by using `cargo workspace ...`). Once published,
the internal versions can then be updated (again, to an *already published* package
version), as needed.
2020-11-08 20:26:46 -06:00
Roy Ivy III c17307c757 fix ~ update workspace pointers to 'uucore' and 'uucore_procs' 2020-11-08 20:26:46 -06:00
Roy Ivy III 94e240a2fc tests/factor ~ refactor for readability + improve DRY 2020-10-26 15:06:29 -05:00
Roy Ivy III c5296f00d0 tests/factor ~ test first 100000 integers for expected results 2020-10-26 15:06:29 -05:00
Roy Ivy III 2615abe9cc tests/factor ~ update RNG usage and variable reports to ease debugging 2020-10-26 15:06:28 -05:00
Roy Ivy III 79b054b016 update deps ~ Cargo.lock 2020-10-14 14:44:07 -05:00
Roy Ivy III 2c4af65dc5 deps ~ update uucore dependency (use 'canary' everywhere for CI testing) 2020-06-13 13:40:19 -05:00
Sylvestre Ledru ac34d136f2 refactor(global): Move from tempdir to tempfile:
* the crate has been deprecated
2020-06-09 11:30:19 +02:00