* reworked arg processing. control character mappings are correctly grouped now, ie 'stty erase ^H'
* stty: setting control chars to undefined (disabling them) is implemented
* setting control chars
* stty: can now set control chars. need to improve checks on valid mappings
* stty: matches GNU in what control character mappings are allowed
* stty: run rustfmt and remove extra comments
* stty: setting control char code review fixes
* stty: fix rustfmt errors
* stty: more small edits after review
* stty: refactor set control char changes for better testing
* stty: fix ci error
* stty: fix issues from code review
libstdbuf is currently compiled as e.g. liblibstdbuf.so, which is confusing.
Compile the library as libstdbuf.so instead.
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
* Fix linting and style issues
* Change condition to not fail for dangling symlinks
The function `move_files_into_dir` had a condition that failed when a
dangling symlink was moved into a folder, which resulted in a file
or directory doesn't exist error
* Added a test case
Pre-commits are usually used to minimize busy work by the contributors, e.g., by fixing extra spacing, formatting, etc. This PR adds various basic text file checks to the repo. I also made yaml spacing a bit cleaner.
I was a bit surprised it is used for `cargo clippy` because you wouldn't want clippy's auto-fixes to be auto-applied by CI, so usually GitHub workflow simply checks runs it regularly. This is outside of the scope for this PR, but perhaps it should be removed here?
parse_digits_count is a significant hotspot in parsing code.
In particular, any add/mul operation on BigUint is fairly slow,
so it's better to accumulate digits in a u64, then add them
to the resulting BigUint.
Saves about 15-20% performance in `sort -g`.
It turns out repeatedly calling i64::MAX.into() and i64::MIN.into()
is actually very expensive. Just do the conversion first, and if
it fails, we know why.
Sadly there is still a conversion happening under the hood in
`-exponent + scale`, but that'd need to be fixed in Bigint.
Improves sort -g performance by ~5%.
* cp: migrate from quick-error to thiserror
fixes: #7916
* Remove quick-error
Now that we have migrated to thiserror, we can remove quick-error
* cp: fix test failures
* cp: fix fmt error
Recent cargo clippy prefers to use if let for single pattern.
For some reason it only triggers on one of the LANG restore case though,
but we can just fix them all.