Commit graph

453 commits

Author SHA1 Message Date
Tyler
06dcdc0f1f Implements status=LEVEL parser. 2021-06-15 12:19:18 -07:00
Tyler
8141919064 Implements count=N
- Adds tests for count=READS and count=BYTES.
- Implements count logic for read count and bytes count limits.
2021-06-15 11:06:36 -07:00
Tyler
fc110bb656 Implements status=LEVEL
- Adds print fn's
- Modifies internal fn's as needed to track read/write state
- Modifies status update thread to respect status level
- Adds signal handler for SIGUSR1 (print xfer stats)
2021-06-11 17:00:25 -07:00
Tyler
a511db504b Minor optimization in calculation of lcm for internal r/w buffer. 2021-06-08 14:33:48 -07:00
Tyler
96fd665ce1 Implements internal read/write buffer optimization
- Spoiler Alert: Turns out it was just the lcm.
2021-06-08 14:14:19 -07:00
Tyler
ef6c850833 Adds additional conv=sync test for short reads. 2021-06-08 12:37:03 -07:00
Tyler
841faebdac Impl conv=sync
- Adds tests where ibs causes extention
- Impl conv=sync. All tests passing.
2021-06-07 16:13:46 -07:00
Tyler
f7eaf96eda Fixes bugs. Prepares for conv=sync
- Splits read fn into conv=sync and standard (consecutive)
  versions.
- Fixes bug in previous read/fill where short reads would copy to wrong
  position in output buffer.
- Fixes bug in unit tests. Empty source would pass (since no bytes
  failed to match).
2021-06-04 11:29:41 -07:00
Tyler
787b9696cb Implements Unblock
- Adds unit tests
- Implements unblock
- All tests passing
2021-06-02 15:11:14 -07:00
Tyler
7bc151d561 Project structure refactor (cont'd)
- Move test macros to specific modules.
2021-06-01 13:02:02 -07:00
Tyler
ead3c8c8fc Project structure refactor.
- Unit tests split into individual folders
- Parseargs test module renamed unit_tests to match new structure
2021-06-01 12:53:23 -07:00
Tyler
391a175dbb Fix regression in converison logic. 2021-06-01 12:34:15 -07:00
Tyler
48374ab0a2 Imlements block. All tests passing. 2021-06-01 11:39:18 -07:00
Tyler
f2fa1e1be1 Adds additional test resources & unit tests for block. 2021-05-29 15:22:42 -07:00
Tyler
d0b4fe34c1 Refactor. Returns code to buildable
- Pushes file/stdout specific logic to trait objects.
- Extracts read/write helper
- Extracts conv/block/unblock helper
- Impl block
- WIP: Many failing tests!
2021-05-27 15:55:29 -07:00
Tyler
d97672dfd3 Continues impl
- Completes impl of skip=N, and seek=N
- Parses cbs=N
2021-04-27 12:21:35 -07:00
Tyler
4d7be2f098 Implements functionality for seeking output files
- Adds duplicate dd fn :-( for differentiating between File backed and
  non-File outputs.
- Implements cflag=sparse,fsync,fdatasync which were previously blocked.
- Adds plumbing for IFlags & OFlags incl parsing.
- Partial impl for seek=N and skip=N which were previously blocked.
2021-04-26 15:17:48 -07:00
Tyler
3c3af72d9a Implements noerror (ignores read errors) 2021-04-22 14:14:32 -07:00
Tyler
beb7abcff0 Implements swab. Adds odd & even tests. 2021-04-22 13:19:51 -07:00
Tyler
5aabdf854d Adds plumbing for conv=sparse. Not impl.
- conv=sparse option requires knowledge of File/Stdout to change
  behaviour.
- Unclear how best to impl this.
- Possible option: develop 4 versions of dd<X,Y> for each valid pair of { File, Stdin,
  Stdout }.
2021-04-22 10:56:33 -07:00
Tyler
b461f102cc Testt conv arg parsing. 2021-04-21 15:24:14 -07:00
Tyler
7f7dd2ad4e Improves multiplier tests 2021-04-08 19:14:26 -07:00
Tyler
9e933a3860 Completes refactor & clean-up. Implements full conv flag parsing.
- All conv flags now parsed (full functionality is TODO)
- Changes functionality of eg. conv=ebcdic,ucase to match gnudd
2021-04-08 19:07:52 -07:00
Tyler
5c8c7efe68 Starts arg parsing. Cleans & refactors.
- Moves all arg parsing & tests to parseargs.rs
- Moves conversion tables to conversion_tables.rs
- Adds ebcdic_lcase and _ucase tables
- Refactors options: This **Breaks Write for Output**
2021-04-06 20:44:37 -07:00
Tyler
4996308753 Builds out arg parsing. Adds support for if, of, & multiplier strings)
- Adds support for calling dd fn from cl
- Adds basic cl tests from project root
- Adds support for multiplier strings (c, w, b, kB, KB, KiB, ... EB, E,
  EiB.
2021-04-03 12:59:03 -07:00
Tyler
0df457596c Implements conversions:- ascii, ebcdic, ibm, lcase, ucase- adds (simple) tests for conversions 2021-03-25 18:32:47 -07:00
ty
d6086fc649 Adds impl & tests
- implements basic copy & progress functionality
- rough work for conversion tables
- adds sanity tests (mt, zeros, ones, deadbeef & rand)
2021-03-18 14:38:08 -07:00
ty
28e6d0d385 Develop prototype code
- Move code closer to real impl
- Remove Makefile from repo
2021-03-16 19:39:22 -07:00
ty
5271427193 Merge branch 'master' of github.com:backwaterred/coreutils into implement-dd-bwtr 2021-03-16 14:37:01 -07:00
ty
af6bf3a224 Begins work on dd
- Prototype code.
- Adds project boilerplate for integration with coreutils framework.
2021-03-16 14:32:55 -07:00
Chirag Jadwani
116e253cc0 uniq: Fix skip fields
Current implementation of the skip fields logic does not handle
multibyte code points correctly. It assumes each code point (`char`) is
one byte. If the skipped part of the input line has any multibyte code
points then this can cause fields not being skipped correctly (field
start index is calculated to be before it actually starts).
2021-03-15 18:48:54 +05:30
Chirag Jadwani
ce4342d12e uniq: Fix panic on invalid utf-8 input 2021-03-15 18:48:54 +05:30
Andre Julius
2158b2c5b4
sleep: move from getopts to clap #1735 (#1777)
and Add some sleep test cases #1735
2021-03-13 23:11:11 +01:00
Terts Diepraam
fd5ec099d0
touch: use an ArgGroup for sources and turn macros into functions (#1813)
* touch: use arggroup for sources

* tests/touch: add tests for multiple sources

* touch: turn macros into functions

* test/touch: fmt

* touch: constant for the sources ArgGroup
2021-03-13 17:20:39 +01:00
Michael Kefeder
e1626b8c64
ptx: ignore empty regex (#1808)
* ptx: ignore empty -W regex

* ptx: test to verify empty -W regex is ignored

* tests/ptx: verify word regexp from cmd-line is used
2021-03-12 21:52:37 +01:00
Ali
5ced3a670b
paste: cleanup multi-stdin support (#1803)
cleaner impl for multi-stdin support
2021-03-12 13:26:09 +01:00
Craig Pastro
3ab114f283
cp: Implement --parents & --parent (#1797) 2021-03-12 13:25:15 +01:00
Ali
374a4fde86
paste: support multi-stdin (#1791)
- added `-` as the default input, since `paste` reads stdin if no file
is provided
- `paste` also supports providing `-` multiple times
- added a test for it
2021-03-10 23:19:12 +01:00
Mikadore
734ef0a8a1
uniq: fixed #550 (#1790) 2021-03-10 21:54:31 +01:00
John Eckersberg
08eb56f120 Fix some clippy warnings 2021-03-10 08:42:00 -05:00
Sylvestre Ledru
517b2a6a22
Merge pull request #1767 from FelipeLema/mod_opt
Group OPT_ARGUMENTS into mods
2021-03-09 22:57:30 +01:00
Sylvestre Ledru
955b7ee6d5
Merge pull request #1785 from ali5h/paste-clap
paste: move from getopts to clap
2021-03-09 22:52:16 +01:00
Felipe Lema
d1addc97cc missing OPT_ s 2021-03-09 18:10:04 -03:00
Ali Shariat
54eebebff8 paste: move from getopts to clap
closes #1734
2021-03-09 12:46:27 -08:00
Sylvestre Ledru
a96ca1359e
Merge pull request #1772 from foxbenjaminfox/master
cp: implement --strip-trailing-slashes
2021-03-09 20:10:06 +01:00
Edward Betts
e1a9c19b6f Correct spelling 2021-03-09 15:19:35 +00:00
Benjamin Fox
5446ea2abf cp: implement --strip-trailing-slashes 2021-03-09 12:59:26 +02:00
Daniel Rocco
0e02607dc7 numfmt: implement --field 2021-03-08 10:53:34 -05:00
Felipe Lema
75b3bc02eb uniq 2021-03-08 12:02:46 -03:00
Felipe Lema
3e0a10d732 update wc 2021-03-08 11:50:26 -03:00