Commit graph

5365 commits

Author SHA1 Message Date
Jan Scheer
d57f474ae1
test_whoami: refactor use expected_result and whoami from common/util.rs 2021-07-08 00:21:28 +02:00
Jan Scheer
abc59fbe85
tests/common: refactor: use TestScenario instead of util_name for expected_result() 2021-07-07 22:46:16 +02:00
Jan Scheer
31aa8b2062
test_du: refactor use expected_result from common/util.rs 2021-07-07 22:09:01 +02:00
Jan Scheer
735ec4014e
test_who: refactor use expected_result from common/util.rs 2021-07-07 17:26:59 +02:00
Jan Scheer
805e024794
test_stat: refactor use expected_result from common/util.rs 2021-07-07 15:54:03 +02:00
Jan Scheer
90de4257b1
test_pinky: refactor use expected_result from common/util.rs 2021-07-07 15:53:46 +02:00
Jan Scheer
c2bd7ae9b1
test_id: refactor use expected_result from common/util.rs 2021-07-07 15:53:26 +02:00
Jan Scheer
9631d8cf2b
test_groups: refactor use expected_result from common/util.rs 2021-07-07 15:52:56 +02:00
Jan Scheer
c447863c8d
tests/common: refactor to reduce duplicate code
* move fn expected_result to common/util.rs
* move fn check_coreutil_version to common/util.rs
* move fn whoami to common/util.rs
* move macro unwrap_or_return to common/macros.rs
* add documentation
* add tests
2021-07-07 14:59:14 +02:00
Sylvestre Ledru
54b389fd1a
Merge pull request #2472 from 353fc443/hostname-uresult
Added UResult for hostname, hostid and dirname
2021-07-06 11:41:56 +02:00
Terts Diepraam
e253fb89db Merge branch 'master' into hostname-uresult 2021-07-06 11:21:42 +02:00
Sylvestre Ledru
41d289377b
Merge pull request #2475 from sylvestre/clip
silent buggy clippy warning
2021-07-04 20:15:40 +02:00
Sylvestre Ledru
f2e12fee0a Silent buggy clippy warnings
Fails with:
```
error: use of irregular braces for `write!` macro
  --> src/uucore/src/lib/features/encoding.rs:19:17
   |
19 | #[derive(Debug, Error)]
   |                 ^^^^^
   |
   = note: `-D clippy::nonstandard-macro-braces` implied by `-D warnings`
help: consider writing `Error`
  --> src/uucore/src/lib/features/encoding.rs:19:17
   |
19 | #[derive(Debug, Error)]
   |                 ^^^^^
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
   = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)
```
2021-07-04 19:06:37 +02:00
Sylvestre Ledru
1136221f6f rustfmt the recent change 2021-07-04 13:01:31 +02:00
353fc443
d0805605e0
imported UUsageError 2021-07-04 16:09:55 +05:30
Sylvestre Ledru
38c0880989
fix the clippy warning 2021-07-04 12:03:36 +02:00
Sylvestre Ledru
e4204fcf07
Merge pull request #2436 from hbina/hbina-ls-refactor-options-module
ls: Refactored options and other long constants to fix formatting
2021-07-04 11:59:06 +02:00
Sylvestre Ledru
aa79e7a8c2
Merge pull request #2342 from Mikadore/master
Test `head` being able to work on invalid utf8
2021-07-04 11:58:10 +02:00
Sylvestre Ledru
ae1935c3cb
Merge branch 'master' into master 2021-07-04 11:57:59 +02:00
Sylvestre Ledru
ec1a301c56
Merge pull request #2473 from tertsdiepraam/usage-error
uucore: add usage errors
2021-07-04 11:46:07 +02:00
Sylvestre Ledru
91078cfcb3
Merge pull request #2445 from syukronrm/du-inodes
du: add `--inodes`
2021-07-04 11:28:03 +02:00
Sylvestre Ledru
010919a9a9
Merge pull request #2460 from miDeb/completions-errors
coreutils: better errors for invalid args for completions
2021-07-04 11:27:26 +02:00
Sylvestre Ledru
d3652cc3c0
Merge pull request #2457 from Funky185540/install-implement-backup
install: implement --backup, -b and -S
2021-07-04 09:57:45 +02:00
Terts Diepraam
e46ce2947e add usage error 2021-07-02 19:31:16 +02:00
353fc443
23f5f55560
Added UResult for dirname 2021-07-02 12:14:24 +00:00
353fc443
f66f10c4ed
Added UResult for hostid 2021-07-02 12:03:14 +00:00
353fc443
330db2eb3e
Added UResult for hostname 2021-07-02 08:19:33 +00:00
Terts Diepraam
5a40148602
Merge pull request #2463 from miDeb/wrap-help
all utils: enable wrap_help
2021-07-01 13:18:32 +02:00
Terts Diepraam
7a0a7aecc4
Merge pull request #2461 from miDeb/sort/check-no-out
sort: disable -o with -C and -c
2021-07-01 13:07:05 +02:00
Terts Diepraam
6213a2a967
Merge pull request #2462 from miDeb/sort/version
sort/ls: implement version cmp matching GNU spec
2021-07-01 13:02:59 +02:00
Sylvestre Ledru
2020df5dd7
Merge pull request #2469 from deantvv/arch-match-gnu-error
arch: match GNU error
2021-06-30 23:10:28 +02:00
Dean Li
b21e01bcb0
arch: match GNU error
Follow up for #2466 as suggested by @miDeb
2021-06-30 22:32:59 +08:00
Sylvestre Ledru
01f687f09f
Merge pull request #2466 from deantvv/arch-uresult
arch: use UResult
2021-06-29 22:29:19 +02:00
Dean Li
92bfaea3fa
arch: use UResult 2021-06-29 19:48:20 +08:00
Sylvestre Ledru
2428a1ccfb
Merge pull request #2355 from tertsdiepraam/improve-error-handling
Improve error handling with `UResult`
2021-06-28 15:46:14 +02:00
Terts Diepraam
0cfaaeceda touch: adapt to standardized error handling 2021-06-28 13:55:55 +02:00
Terts Diepraam
73a7ead857 mktemp: adapt to standardized error handling 2021-06-28 13:55:55 +02:00
Terts Diepraam
8c5052fcb7 mkdir: adapt to standardized error handling 2021-06-28 13:55:37 +02:00
Terts Diepraam
e4eac825fb ls: adapt to standardized error handling 2021-06-28 13:49:57 +02:00
Terts Diepraam
60e4621c3b uucore_procs: add temporary proc macro gen_uumain for standardized error handling 2021-06-28 13:49:56 +02:00
Terts Diepraam
43bfec7170 uucore/error: add macros for standardized error handling 2021-06-28 13:49:45 +02:00
Terts Diepraam
66b1ac019d uucore/error: add standardized error handling (adds UResult & UError) 2021-06-28 13:49:35 +02:00
Syukron Rifail M
27e0507844 du: more tests 2021-06-28 07:51:17 +07:00
Syukron Rifail M
d8a33da5b3 du: add --inodes 2021-06-28 07:51:17 +07:00
Andreas Hartmann
1a43a94e31 install: Apply rustfmt 2021-06-27 17:59:04 +02:00
Michael Debertol
d3732e08c4 sort: disable -o with -C and -c 2021-06-27 16:21:18 +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
0dda72eb60 coreutils: better errors for invalid args for completions
Use clap to extract command line arguments. This generates much better
error messages.
2021-06-27 16:07:43 +02:00
Michael Debertol
233a778963 sort/ls: implement version cmp matching GNU spec
This reimplements version_cmp, which is used in sort and ls to sort
according to versions.
However, it is not bug-for-bug identical with GNU's implementation.
I reported a bug with GNU here:
https://lists.gnu.org/archive/html/bug-coreutils/2021-06/msg00045.html
This implementation does not contain the bugs regarding the handling of
file extensions and null bytes.
2021-06-27 15:29:17 +02:00
Andreas Hartmann
69e8838b27 tests: install: Add tests for '--backup'
Tests the '--backup' option for the install utility. Most of the code is
adapted from the respective tests for 'mv'.
2021-06-27 09:55:10 +02:00