Commit graph

5864 commits

Author SHA1 Message Date
Tyler
418ecbe61a Makes multiplier parsing system dependant
- multipler is now created as u128, then returned as usize after
  conversion. Errors due to overflow now depend on the system on which
the code is run.
2021-07-05 11:27:17 -07:00
Andreas Hartmann
9d94307880 mv: Adapt for new backup_control utilities 2021-07-05 12:44:44 +02:00
Andreas Hartmann
a783d05101 backup_control: Add module tests
Adds a tests submodule that performs tests on the
`determine_backup_mode` function to ensure it handles backup options
like specified by [GNU][1].

[1]: https://www.gnu.org/software/coreutils/manual/html_node/Backup-options.html
2021-07-05 12:44:44 +02:00
Andreas Hartmann
89c6d32a20 backup_control: Refactor backup mode determination
Refactor the function that determines which backup mode to select based
on user input. It now complies with what the [GNU manual][1] specifies.

[1]: https://www.gnu.org/software/coreutils/manual/html_node/Backup-options.html
2021-07-05 12:44:40 +02:00
Andreas Hartmann
1309757d4d backup_control: Make utility functions private 2021-07-05 12:43:28 +02:00
Andreas Hartmann
fa0b4861b9 backup_control: Match abbreviated backup options
Add a function that takes a user-supplied backup option and checks if it
matches any of the valid backup options. This is because GNU allows to
abbreviate backup options, as long as they are valid and unambiguous.

In case a backup option is either invalid or ambiguous, an error type is
returned that contains a formatted error string for output to the user.
2021-07-05 12:43:28 +02:00
Andreas Hartmann
3b8f135842 backup_control: Add backup help string from GNU utils
The previous help string for the backup subroutines didn't comply with
the formatting found in the `--help` output of e.g. `mv` or `ln`.

Use the exact help string from these utilities instead.
2021-07-05 12:43:28 +02:00
Jan Scheer
f383f36164
Merge branch 'master' into id_selinux_context 2021-07-05 12:34:53 +02:00
Sylvestre Ledru
41d289377b
Merge pull request #2475 from sylvestre/clip
silent buggy clippy warning
2021-07-04 20:15:40 +02:00
Anup Mahindre
a9ba4c6d9f du: Use UResult 2021-07-04 22:44:25 +05:30
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
Tyler
860cbc6311 Removes or ignores all compiler warnings 2021-07-02 15:30:46 -07:00
Tyler
8e862b86dd More minor cleanup.
- Runs rustfmt.
- Speel check help-text
2021-07-02 14:24:01 -07:00
Tyler
7f03ecf74b Adds failures & tests for unimplmented flags. 2021-07-02 13:17:34 -07:00
Tyler
416488c560 Edits README.
- Moves dd from To Do, to Semi-Done
2021-07-02 11:57:35 -07:00
Tyler
5b030b4855 Minor cleanup
- Removes compiler warnings.
- Renames conv=nocreat test to be more descriptive.
2021-07-02 11:50:33 -07:00
backwaterred
9c38583c6b
Merge pull request #2 from uutils/master
catchup with uutils main
2021-07-02 11:34:22 -07:00
Tyler
951d9c0822 Completes transition to clap
- fixes build issues in parser tests.
2021-07-02 11:31:06 -07:00
Tyler
4d76cb45de Fixes odd build error in file I did not touch.
- Adds 'full' features required for imported struct.
- see https://docs.rs/syn/1.0.73/syn/struct.ItemFn.html
2021-07-02 11:09:51 -07:00
Tyler
461fd1017a Merge branch 'uutils-master' 2021-07-02 10:55:16 -07:00
Tyler
8334d9f574 Build changes after merge with uutils main 2021-07-02 10:53:15 -07: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
Tyler
92281585a7 Merge branch 'master' of https://github.com/uutils/coreutils into uutils-master 2021-07-01 14:33:30 -07: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
Tyler
17cfba41cc Implements project testfing from root.
- conv=FLAG testing. (1) WIP conv=nocreat
- iflag & oflag testing.
- conv=CONV ascii,...,ucase,...,block,...sync tests at unit-test-level
  (project root is todo)
2021-06-30 14:47:48 -07: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
Michael Debertol
cd83aed89c test: go into '[' mode when executable ends with [
This makes [ work even when installed with a custom prefix, e.g. as uu-[.
2021-06-29 00:28:01 +02:00
Michael Debertol
97d14893a1 [: install test as [ as well 2021-06-29 00:27:58 +02: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