Commit graph

4403 commits

Author SHA1 Message Date
Jamie Quigley
31f5666727
more: add error message if the argument is a directory (#1983) 2021-04-02 22:34:02 +02:00
Sandro
9fbed0b07a
makefile: replace all uutils with coreutils (#1815)
Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2021-04-02 22:18:31 +02:00
Sivachandran
9151410d08
csplit: move from getopts to clap (#1995) 2021-04-02 22:14:56 +02:00
Sylvestre Ledru
18c2083c61
Merge pull request #2010 from jurodr/install-improve-d
install: Fix behaviour of the '-d' flag
2021-04-02 21:53:49 +02:00
Juliana Rodrigueiro
97da14fcb2 install: Fix behaviour of the -d flag
The '-d' flag should create all ancestors (or components) of a
directory regardless of the presence of the "-D" flag.

From the man page:
       -d, --directory
              treat all arguments as directory names; create all components of the specified directories

With GNU:
    $ install -v -d dir1/di2
    install: creating directory 'dir1'
    install: creating directory 'dir1/di2'
With this version:
    $ ./target/release/install -v -d dir3/di4
    install: dir3/di4: No such file or directory (os error 2)
    install: dir3/di4: chmod failed with error No such file or directory (os error 2)
    install: created directory 'dir3/di4'

Also, one of the unit tests misinterprets what a "component" is,
and hence was fixed.
2021-04-02 20:04:25 +01:00
Juliana Rodrigueiro
2a02f01fc2 install: Don't display success message when the dir was not created
Also don't run chmod when we just failed to create the directory.

Behaviour before this patch:

    $ ./target/release/install -v -d dir1/dir2
    install: dir1/dir2: Permission denied (os error 13)
    install: dir1/dir2: chmod failed with error No such file or directory (os error 2)
    install: created directory 'dir1/dir2'
2021-04-02 19:59:43 +01:00
Juliana Rodrigueiro
349c4f7af6 install: Make log message identical to GNU install
$ install -v -d dir1
    install: creating directory 'dir1'
2021-04-02 19:59:43 +01:00
Sylvestre Ledru
4934af0c3d
Merge pull request #2007 from drocco007/fold-preserve-blank-lines
fold: preserve blank lines
2021-04-02 20:00:05 +02:00
Sylvestre Ledru
a1b8996ef2
Merge pull request #2006 from reggaemuffin/fmt-1.40.0
chores: run `cargo +1.40.0 fmt`
2021-04-02 17:11:54 +02:00
Daniel Rocco
d12f96d9ca fold: preserve blank lines 2021-04-02 10:14:11 -04:00
ReggaeMuffin
2eb32d845e
chores: run cargo +1.40.0 fmt
Apparently fmt from 1.40.0 is a bit more strict in some places

Let me know if this is worthwhile merging :)
2021-04-02 10:56:49 +01:00
Sylvestre Ledru
de6aa69259
Merge pull request #1997 from sylvestre/polish3
Rustfmt+clippy+cargo.lock update
2021-04-02 11:37:56 +02:00
Jan Scheer
4a6176855a
relpath: move from getops to clap (#1939) (#1990)
* relpath: add tests

* relpath: move from getopts to clap
2021-04-02 09:55:57 +02:00
Sylvestre Ledru
8d2e4e4b71
Merge pull request #2000 from paulotten/issue1999
Consistency with GNU version of `du` when doing `du -h` on an empty file
2021-04-02 08:22:51 +02:00
Paul Otten
7859bf885f Consistency with GNU version of du when doing du -h on an empty file 2021-04-01 19:42:43 -04:00
Paul Otten
7112182dbc Consider device id when comparing files 2021-04-01 18:37:20 -04:00
Sylvestre Ledru
dcbcf01665 Fix some clippy warnings 2021-04-01 23:42:30 +02:00
Sylvestre Ledru
6734ce785d rustfmt the recent changes 2021-04-01 23:25:37 +02:00
Sylvestre Ledru
9c2cd81b11 refresh cargo.lock with recent updates 2021-04-01 23:18:57 +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
Árni Dagur
7a947cfe46
cat: Improve performance on Linux (#1978)
* cat: Improve performance, especially on Linux

* cat: Don't use io::copy for splice fallback

On my MacBook Pro 2020, it is around 25% faster to not use io::copy.

* cat: Only fall back to generic copy if first splice fails

* cat: Don't double buffer stdout

* cat: Don't use experimental or-pattern syntax

* cat: Remove nix symbol use from non-Linux
2021-04-01 23:08:48 +02:00
Terts Diepraam
2941dfd698
ls: quoting style (#1989) 2021-04-01 22:50:13 +02:00
Sylvestre Ledru
cc9c846032
Merge pull request #1991 from Mikadore/od_test
od: refactor tests for #1982
2021-04-01 09:50:25 +02:00
Aleksandar Janicijevic
cf4970f083
shred: Replaced eprintln with show_error (#1992) 2021-04-01 08:53:48 +02:00
Mikadore
bb3e93372f od: refactor tests for #1982 2021-04-01 02:16:15 +02:00
Alessandro Stoltenberg
7669a4387a
echo: Some minor changes to options (#1960) 2021-03-31 22:27:24 +02:00
Yagiz Degirmenci
e958864bd9
tac: exit with proper code, move from getopts to clap, add test for invalid inputs (#1957) 2021-03-31 21:21:10 +02:00
Aleksandar Janicijevic
751ae6a8f8
shred: use clap for argument management (#1961) 2021-03-31 21:19:04 +02:00
Sylvestre Ledru
9bb588d69a
Merge pull request #1981 from Mikadore/master
fixed panic! formatting for tests
2021-03-31 14:28:11 +02:00
Mikadore
b8079098f2 fixed panic! formatting 2021-03-31 13:30:06 +02:00
Mikadore
96643d6f91
fix #1970 (#1980) 2021-03-31 03:54:16 -07:00
Mikadore
a57f17ac5b
Expand CmdResult's API (#1977) 2021-03-31 02:25:23 -07:00
Sylvestre Ledru
d3cd1f960c
Merge pull request #1974 from desbma/master
Add pre-commit instructions
2021-03-30 22:22:01 +02:00
desbma
ba315de6aa Add pre-commit instructions 2021-03-30 21:39:24 +02:00
desbma
be03c948ed
Add pre-commit hook + run fmt (#1959) 2021-03-30 21:24:01 +02:00
Sylvestre Ledru
da18ffa496 refresh cargo.lock with recent updates 2021-03-30 20:54:25 +02:00
Árni Dagur
698dab12a6
wc: Don't read() if we only need to count number of bytes (Version 2) (#1851)
* wc: Don't read() if we only need to count number of bytes

* Resolve a few code review comments

* Use write macros instead of print

* Fix wc tests in case only one thing is printed

* wc: Fix style

* wc: Use return value of first splice rather than second

* wc: Make main loop more readable

* wc: Don't unwrap on failed write to stdout

* wc: Increment error count when stats fail to print

* Re-add Cargo.lock
2021-03-30 20:53:02 +02:00
Neculai Balaban
3e06882acc
loosely document supported architectures (#1899)
- add script to generate a table of bins that compile
- add section in README
2021-03-30 20:51:11 +02:00
Kourosh
775682508a
more: move from getopts to clap (#1962) 2021-03-30 20:39:58 +02:00
Sylvestre Ledru
a5402eed41
Merge pull request #1967 from jhscheer/iss1775
chmod: fixed behavior for dangling symlinks (#1775)
2021-03-30 20:30:16 +02:00
Sivachandran
9024769808
Add instructions for code coverage report generation (#1963) 2021-03-30 08:33:24 +02:00
Jan Scheer
2647a72e9e chmod: fixed behavior for dangling symlinks (#1775) 2021-03-29 22:07:09 +02:00
Yagiz Degirmenci
25df51a525
fix(cksum): check metadata of the path (#1951)
* fix: check metadata of the path

* chore: use existing path
2021-03-29 18:44:42 +02:00
Raymond Wang
d88de3c6a6
tr: more explicit flag names (#1966) 2021-03-29 17:16:48 +02:00
Sylvestre Ledru
32ddef9b9e
refresh cargo.lock with recent updates (#1964) 2021-03-29 14:35:12 +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
Mikadore
8320b1ec5f
Rewrote head (#1911)
See https://github.com/uutils/coreutils/pull/1911
for the details
2021-03-29 13:08:48 +02:00
electricboogie
da5f2f3a6c
sort: Add a GNU-style Random Sorter (#1922) 2021-03-29 13:05:52 +02:00
Yagiz Degirmenci
8cc7a90d7c
sum: fix crash on invalid inputs, move to clap, add tests (#1952) 2021-03-29 13:03:56 +02:00
Raymond Wang
ab5b6dd844
tr: move from getopts to claps #1929 (#1954) 2021-03-29 13:03:24 +02:00