Jeffrey Finkelstein
7af3007204
split: add --verbose option
2022-01-16 09:34:28 -05:00
Terts Diepraam
ecf6f18ab3
split: clap 3
2022-01-11 19:16:48 +01:00
Jeffrey Finkelstein
cfe5a0d82c
split: correct filename creation algorithm
...
Fix two issues with the filename creation algorithm. First, this
corrects the behavior of the `-a` option. This commit ensures a
failure occurs when the number of chunks exceeds the number of
filenames representable with the specified fixed width:
$ printf "%0.sa" {1..11} | split -d -b 1 -a 1
split: output file suffixes exhausted
Second, this corrects the behavior of the default behavior when `-a`
is not specified on the command line. Previously, it was always
settings the filenames to have length 2 suffixes. This commit corrects
the behavior to follow the algorithm implied by GNU split, where the
filename lengths grow dynamically by two characters once the number of
chunks grows sufficiently large:
$ printf "%0.sa" {1..91} | ./target/debug/coreutils split -d -b 1 \
> && ls x* | tail
x81
x82
x83
x84
x85
x86
x87
x88
x89
x9000
2022-01-10 20:43:22 -05:00
Jeffrey Finkelstein
e5d6b7a1cf
split: correct arg parameters for -b option
2022-01-10 20:43:22 -05:00
Jeffrey Finkelstein
1f937b0760
split: return UResult from uumain() function
2021-12-31 12:19:36 -05:00
Jeffrey Finkelstein
8f04613a84
split: create Strategy enum for chunking strategy
2021-12-30 22:18:17 -05:00
Jeffrey Finkelstein
25d0ccc61d
split: move parsing outside of *Splitter::new()
...
Move the parsing of the output chunk size from inside
`ByteSplitter::new()` and `LineSplitter::new()` to outside. This
eliminates duplicate code and reduces the responsibilities of the
`ByteSplitter` and `LineSplitter` implementations.
2021-12-30 22:17:26 -05:00
Jeffrey Finkelstein
75e742a008
split: correct help text for -l option
2021-12-30 22:17:20 -05: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
Jan Verbeek
acfd1ebe57
fixup! Run clippy on the full workspace
2021-08-24 17:28:10 +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
c0854000d1
refactor ~ use execution_phrase!()
for usage messaging
2021-08-14 14:01:33 +02:00
Roy Ivy III
23b68d80ba
refactor ~ usage()
instead of get_usage()
2021-08-14 13:58:43 +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
c0be979611
fix some issues with locale (replace "LANGUAGE" with "LC_ALL")
...
`LANGUAGE=C` is not enough, `LC_ALL=C` is needed as the environment
variable that overrides all the other localization settings.
e.g.
```bash
$ LANGUAGE=C id foobar
id: ‘foobar’: no such user
$ LC_ALL=C id foobar
id: 'foobar': no such user
```
* replace `LANGUAGE` with `LC_ALL` as environment variable in the tests
* fix the the date string of affected uutils
* replace `‘` and `’` with `'`
2021-06-23 11:30:28 +02:00
Jan Scheer
1b824f4914
fix clippy warnings
2021-06-09 15:56:29 +02:00
Jan Scheer
be8650278b
Merge branch 'master' into refactoring_parse_size
2021-06-09 13:44:40 +02:00
Roy Ivy III
79a33728ca
refactor/split ~ fix cargo clippy
complaint (clippy::needless_borrow)
2021-06-06 19:28:24 -05:00
Jan Scheer
130bf49e5d
Merge branch 'master' of github.com:uutils/coreutils into refactoring_parse_size
2021-06-03 22:32:34 +02:00
Jan Scheer
ad26b7a042
head/tail/split: make error handling of NUM/SIZE arguments more
...
consistent
* add tests for each flag that takes NUM/SIZE arguments
* fix bug in tail where 'quiet' and 'verbose' flags did not override each other POSIX style
2021-06-03 20:37:29 +02:00
Jan Scheer
2f5f7c6fa1
split: use "parse_size" from uucore
...
* make stderr of parsing SIZE/NUMBER argument consistent with GNU's behavior
* add error handling
* add tests
2021-06-02 21:32:41 +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
451110bba0
refactor/split ~ polish spelling (comments, names, and exceptions)
2021-05-31 08:23:57 -05:00
Roy Ivy III
9c0c8eb59f
change ~ remove 'main.rs' spell-checker exceptions
2021-05-31 08:11:31 -05:00
Jan Scheer
3aeccfd802
fix a lot of clippy warnings
2021-05-29 15:11:22 +02:00
Samuel Ainsworth
2ff9cc6570
Typo in comment
2021-05-08 14:25:21 +02:00
Samuel Ainsworth
bacad8ed93
Use u128 instead of usize for large numbers, and consistency across architectures
2021-05-08 14:25:21 +02:00
Samuel Ainsworth
7c1395366e
Fix split's handling of non-UTF-8 files
2021-05-08 14:25:21 +02:00
Samuel Ainsworth
a9ac7af9e1
Simplify parsing of --bytes for the split command
2021-05-08 14:25:21 +02: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
John Eckersberg
08eb56f120
Fix some clippy warnings
2021-03-10 08:42:00 -05:00
Edward Betts
e1a9c19b6f
Correct spelling
2021-03-09 15:19:35 +00: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
Felipe Lema
35a7f01d15
Refactor(split) - migrate from getopts to clap ( #1712 )
2021-02-11 20:45:23 +01:00
Sylvestre Ledru
beda329a21
Fix some clippy warnings
2021-02-07 15:12:15 +01:00
Sylvestre Ledru
262b508b89
update the dep to uucore 0.0.6
2021-02-01 23:55:43 +01:00
Sylvestre Ledru
a807fc623a
Update to version 0.0.3
2021-01-22 09:40:38 +01:00
Felipe Lema
88911be6e0
--filter
argument for split
(#1681 )
2021-01-18 14:42:44 +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
Sylvestre Ledru
7942a64231
Remove 'extern crate'
...
Not necessary anymore. See:
https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html#no-more-extern-crate
2020-12-31 15:44:00 +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
Jens Humrich
bfca334ec1
style issues
2020-09-17 12:40:48 +02:00
Katzmann1983
f322f72c34
Update src/uu/split/src/split.rs
...
Co-authored-by: Sylvestre Ledru <sledru@mozilla.com>
2020-09-17 10:27:40 +02:00
Jens Humrich
5a75905476
Add additional-suffix option to split
2020-09-16 17:59:39 +02:00
Roy Ivy III
326ff36793
refactor/polosh ~ fix cargo clippy
complaint (reversed_empty_ranges)
2020-07-25 11:09:10 -05: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
f82de13847
docs ~ spell-check repairs and addition of exceptions
2020-05-30 01:36:02 -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
131bca3d53
fix/split ~ fix 'edition=2018' trait specification error
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
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