Update `tsort` so that
* nodes are printed as they are visited,
* cycles are printed as they are discovered,
* finding a cycle doesn't terminate the traversal,
* multiple cycles can be found and displayed.
Fixes#7074
* cp: make --backup and --no-clobber are mutually exclusive
Should fix tests/cp/cp-i.sh
* simplify the test
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
---------
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
Make `tsort` split on any whitespace character instead of just
whitespace within a single line. This allows edge information to be
split with the source node on one line and the target node on another.
For example, after this commit
$ printf "a\nb\n" | tsort
a
b
whereas before this would print an error message.
Closes#7077
Fix the parsing of the `--userspec=USER:GROUP` argument so that the
both the user and the group are optional, and update the error message
to match that of GNU `chroot`. This commit also removes the incorrect
`clap` arguments for `--user` and `--group`. In `chroot --user=USER`,
the `--user` is an abbreviation of `--userspec`, and in `chroot
--group=GROUP`, the `--group` is an abbreviation of `--groups`.
Closes#7040.
This change resolves issues with exponent calculation and usage,
ensuring more accurate formatting:
- Exponent for negative values can differ from 0
- Switching to decimal mode now follows the P > X ≥ −4 rule
* Added error handling to ensure '=' after -u returns 125 as '=' is not allowed
* Added tests for disallow = on short options
* Added error handling to ensure '=' after -u returns 125 as '=' is not allowed
* Added tests for disallow = on short options
* Disallow only short unset option from having '=' as its starting character
* Remove needless tests and update function name for clarity
Fix a subtraction underflow that occurred on `head --bytes=-N` when the
input had fewer than `N` bytes. Before this commit,
printf "a" | head -c -2
would panic. After this commit, it terminates successfully with no
output as expected.
Improve the error message produced by `seq` when given invalid format
specifiers for the `-f` option. Before this commit:
$ seq -f "%" 1
seq: %: invalid conversion specification
$ seq -f "%g%" 1
seq: %: invalid conversion specification
After this commit:
$ seq -f "%" 1
seq: format '%' ends in %
$ seq -f "%g%" 1
seq: format '%g%' has too many % directives
This matches the behavior of GNU `seq`.
Currently fails with:
```
2024-12-28T14:55:18.9330231Z thread 'main' panicked at src/uu/chroot/src/chroot.rs:284:46:
2024-12-28T14:55:18.9330718Z called `Result::unwrap()` on an `Err` value: Custom { kind: NotFound, error: "Not found: nobody:+65535" }
2024-12-28T14:55:18.9331305Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
- improve move-to-self detection, so this errors without data loss:
```diff
mkdir mydir
mv mydir mydir/subdir
-mv: No such file or directory (os error 2)
+mv: cannot move 'mydir' to a subdirectory of itself, 'mydir/subdir'
```
- align "cannot move source to a subdirectory of itself" and "same file"
errors more closely with coreutils:
```diff
mkdir mydir
mv mydir/ mydir/..
-mv: cannot move 'mydir/' to a subdirectory of itself, 'mydir/../mydir/'
+mv: 'mydir/' and 'mydir/../mydir' are the same file
```
Causing: https://github.com/nushell/nushell/issues/13082