Commit graph

102 commits

Author SHA1 Message Date
Ebuka Agbanyim
ae6e3fdaf7 cut: use UResult 2021-12-26 20:56:23 +00:00
Roy Ivy III
f20aa49821 maint/CICD ~ (GHA) fix cargo-udeps false positives (add 'ignore' exceptions to sub-crates) 2021-11-19 17:55:02 -06:00
Sylvestre Ledru
59e9870c56 Prepare version 0.0.8 2021-10-23 19:21:50 +02:00
Sylvestre Ledru
7eaae75bfc add a github action job to identify unused deps 2021-09-15 12:06:50 +02:00
Jan Verbeek
259f18fcab Update message quoting and filename printing 2021-09-07 19:49:01 +02:00
Michael Debertol
252220e9eb refactor/uucore ~ make util_name and execution_phrase functions
Since util_name and execution_phrase no longer rely on features that are
only available to macros, they may as well be plain functions.
2021-08-14 17:55:18 +02:00
Roy Ivy III
c5792c2a0f refactor ~ use util_name!() as clap::app::App name argument for all utils 2021-08-14 13:53:13 +02:00
Sylvestre Ledru
26a882551b update the dep to uucore_procs 0.0.6 2021-07-11 21:04:11 +02:00
Sylvestre Ledru
1d8a66b7d3 Update to version 0.0.7 2021-07-11 18:04:56 +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
0531153fa6 uutils: move clap::App creation to separate functions 2021-06-25 21:23:45 +02:00
Jan Scheer
65f47be5ee cut: fix -d= (#2424) 2021-06-18 12:10:40 +02:00
Terts Diepraam
394eb82af1 cat/cut/tty/nohup: replace is_std{in, out, err}_interactive with atty 2021-06-09 17:12:03 +02:00
Sylvestre Ledru
d8c06dd6bb use clap::crate_version macro instead of the env variable 2021-06-02 19:00:19 +02:00
Roy Ivy III
9c0c8eb59f change ~ remove 'main.rs' spell-checker exceptions 2021-05-31 08:11:31 -05:00
Sylvestre Ledru
167520067c
Merge pull request #2111 from cbjadwani/cut_optimizations
cut: optimizations
2021-04-28 20:40:28 +02:00
Chirag Jadwani
25f99097cc cut: add BENCHMARKING.md
and minor refactoring
2021-04-28 23:28:26 +05:30
Christopher Regali
368e984fac
Change unchecked unwrapping to unwrap_or_default for Args-trait (#1845) (#1852)
* Change unchecked unwrapping to unwrap_or_default for argument parsing (resolving #1845)

* Added unit-testing for the collect_str function on invalid utf8 OsStrs

* Added a warning-message for identification purpose to the collect_str method.

* - Add removal of wrongly encoded empty strings to basename
- Add testing of broken encoding to basename
- Changed UCommand to use collect_str in args method to allow for integration testing of that method
- Change UCommand to use unwarp_or_default in arg method to match the behaviour of collect_str

* Trying out a new pattern for convert_str for getting a feeling of how the API feels with more control

* Adding convenience API for compact calls

* Add new API to everywhere, fix test for basename

* Added unit-testing for the conversion options

* Added unit-testing for the conversion options for windows

* fixed compilation and some merge hiccups

* Remove windows tests in order to make merge request build

* Fix formatting to match rustfmt for the merged file

* Improve documentation of the collect_str method and the unit-tests

* Fix compilation problems with test

Co-authored-by: Christopher Regali <chris.vdop@gmail.com>
Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2021-04-25 23:28:42 +02:00
Chirag Jadwani
2c1459cbfc cut: optimizations
* Use buffered stdout to reduce write sys calls.

This simple change yielded the biggest performace gain.

* Use `for_byte_record_with_terminator` from the `bstr` crate.

This is to minimize the per line copying needed by
`BufReader::read_until`. The `cut_fields` and `cut_fields_delimiter`
functions used `read_until` to iterate over lines. That required copying
each input line to the line buffer. With
`for_byte_record_with_terminator` copying is minimized as it calls our
closure with a reference to BufReader's buffer most of the time.  It
needs to copy (internally) only to process any incomplete lines at the
end of the buffer.

* Re-write `Searcher` to use `memchr`.

Switch from the naive implementation to one that uses `memchr`.

* Rewrite `cut_bytes` almost entirely.

This was already well optimized. The performance gain in this case is
not from avoiding copying. In fact, it needed zero copying whereas new
implementation introduces some copying similar to `cut_fields` described
above. But the occassional copying cost is more than offset by the use
of the very fast `memchr` inside `for_byte_record_with_terminator`.
This change also simplifies the code significantly. Removed the `buffer`
module.
2021-04-24 22:29:48 +05:30
Reto Hablützel
97d12d6e3c fix trivial warnings without features 2021-04-11 16:05:25 +02:00
Yagiz Degirmenci
f47345ec9b cut: add gnu compatability to error messages 2021-04-03 20:55:10 +03:00
Yagiz Degirmenci
e84b60b7d5 cut: add display order 2021-04-03 20:30:28 +03:00
Yagiz Degirmenci
7e677b3e6c cut: fix formatting, use constant values 2021-04-03 20:21:57 +03:00
Yagiz Degirmenci
cfc3d52be4 cut: move to clap 2021-04-03 20:19:30 +03:00
Sylvestre Ledru
f37284129e new release 0.0.6 to address the cat issue 2021-04-03 16:06:58 +02:00
Sylvestre Ledru
ac031dffa4 new release 0.0.5 2021-04-03 10:30:07 +02:00
Daniel Rocco
0e02607dc7 numfmt: implement --field 2021-03-08 10:53:34 -05:00
Sylvestre Ledru
6ad8528b99 update of the uucore dep to 0.0.7 2021-03-07 11:29:38 +01:00
Sylvestre Ledru
6481c5a247 Prepare version 0.0.4 2021-03-07 11:29:38 +01:00
Sylvestre Ledru
262b508b89 update the dep to uucore 0.0.6 2021-02-01 23:55:43 +01:00
Sylvestre Ledru
992c113f09 Remove some old code 2021-01-22 09:40:38 +01:00
Sylvestre Ledru
a807fc623a Update to version 0.0.3 2021-01-22 09:40:38 +01:00
Sylvestre Ledru
b8e886ad1a bump the minimal version of uucore & uucore_procs 2021-01-10 18:27:20 +01:00
Sylvestre Ledru
d9ae043a05
update of the version 0.0.1 => 0.0.2 (#1686) 2021-01-10 18:16:04 +01:00
Roy Ivy III
6539b8c6b9 maint/deps ~ change version specification for dependencies between sub-packages
- refactor internal version specifications to be ">=M.m.p" (where M.m.p is *already published*)

## [why]

Loosening internal version dependencies decreases the coupling between packages such
that packages can be published in a looser order. It allows the packages to be version
updated and published in tandem (ie, by using `cargo workspace ...`). Once published,
the internal versions can then be updated (again, to an *already published* package
version), as needed.
2020-11-08 20:26:46 -06:00
Roy Ivy III
c17307c757 fix ~ update workspace pointers to 'uucore' and 'uucore_procs' 2020-11-08 20:26:46 -06:00
Alex Lyon
110d6844ad
Use an iterator over OsString for uumain()
Additionally, restructure `uname` so that we don't need to find the
iterator's length.
2020-06-16 03:28:02 -05:00
Roy Ivy III
fbbd881ca9 docs ~ reduce sub-crate meta-information keywords to the maximum of five 2020-05-31 15:48:54 -05:00
Roy Ivy III
8cf58de0a7 docs ~ polish/update comments 2020-05-30 01:36:02 -05:00
Roy Ivy III
f82de13847 docs ~ spell-check repairs and addition of exceptions 2020-05-30 01:36:02 -05:00
Roy Ivy III
38ebc14b29 maint/build ~ remove .gitignore from sub-crate 'cut' 2020-05-29 22:59:48 -05:00
Roy Ivy III
ea3235c7e2 change ~ new_coreopts!() => app!() (from uucore v0.0.4) 2020-05-29 22:59:48 -05:00
Roy Ivy III
6f465eeb9f deps ~ update utils to uucore/uucore_procs v0.0.4 2020-05-29 22:59:48 -05:00
Roy Ivy III
d4aa3a2231 fix 'edition="2018"' module import errors
- ref: <https://users.rust-lang.org/t/imports-can-only-refer-to-extern-crate-names/24388> @@ <https://archive.is/iCaXp>
2020-05-29 22:59:47 -05:00
Roy Ivy III
d70db1f7d2 docs ~ improve/update sub-crate meta information 2020-05-29 22:59:47 -05:00
Roy Ivy III
7cfa8be5f2 docs ~ add meta information to sub-crates 2020-05-29 22:59:47 -05:00
Roy Ivy III
db2e950918 change ~ make all sub-crates independent 2020-05-29 22:59:40 -05:00
Roy Ivy III
6606408ce9 refactor/polish ~ whitespace normalization (consistent indentation [either tabs *or* spaces], EOF EOLNs, no trailing whitespace) 2020-05-24 17:29:07 -05:00
Sylvestre Ledru
6e8c901204 fix: typo fixes found by codespell 2020-05-01 23:36:33 +02:00
Roy Ivy III
5aa2b039a5 change ~ fixup paths (within workspace packages) to common code 2020-04-14 13:46:19 -05:00
Roy Ivy III
78c362c8b5 change ~ fixup paths (within workspace packages) 2020-04-14 13:46:18 -05:00
Roy Ivy III
f0b0e3b867 change ~ reorganize code files 2020-04-14 13:46:18 -05:00