Commit graph

3980 commits

Author SHA1 Message Date
tilakpatidar
0098cfe5b7 pr: add ColumnModeOptions and fix reading of input after page range is finished 2021-03-26 14:11:14 +03:00
tilakpatidar
fd4447785b pr: add -r option to suppress errors and -F to use form feed separator
pr: Add -F to print line feed character for page separator
2021-03-26 14:11:14 +03:00
tilakpatidar
9e023b8a91 pr: add -t option to not print header, trailer and -l to print line numbers
pr: Add -l option set number of lines

pr: Refactor opts
2021-03-26 14:11:14 +03:00
tilakpatidar
55043d7a15 pr: print only 28 lines if double spaced option is used 2021-03-26 14:11:14 +03:00
tilakpatidar
9a3c572de8 pr: add --page option 2021-03-26 14:11:14 +03:00
tilakpatidar
c58ee96abf pr: add long names for -d and -h 2021-03-26 14:11:14 +03:00
tilakpatidar
420a066312 pr: add read buffer size and fix unused Result types 2021-03-26 14:11:14 +03:00
tilakpatidar
8c7cbf65a5 pr: throw error on reading from socket 2021-03-26 14:11:14 +03:00
tilakpatidar
1cf84a7305 pr: refactor option flags into constants 2021-03-26 14:11:14 +03:00
tilakpatidar
77d3d08f0b pr: show current time for stdin input 2021-03-26 14:11:14 +03:00
tilakpatidar
781d77eb3c pr: add support for -d option 2021-03-26 14:11:14 +03:00
tilakpatidar
2d609b2cd1 pr: add custom errors
pr: code refactoring for references
2021-03-26 14:11:14 +03:00
tilakpatidar
e69c9ada34 pr: read from stdin 2021-03-26 14:11:14 +03:00
tilakpatidar
7f87e42ad1 pr: add support for multiple files 2021-03-26 14:11:14 +03:00
tilakpatidar
9111f168aa pr: add -h to print header and -n to print line numbers
pr: Add -h to print custom header instead of file name

pr: Add -n to print line numbers
2021-03-26 14:11:14 +03:00
tilakpatidar
2ee90ab09a pr: print pr header with file last modified time, path and page number 2021-03-26 14:11:14 +03:00
tilakpatidar
2d58ea5f8b pr: print 56 lines of content with 5 blank trailer and header lines 2021-03-26 14:11:14 +03:00
Max Semenik
035f811dd0
Fix "panic message is not a string literal" warnings (#1915)
New in Rust 1.51.

Closes #1914
2021-03-26 11:09:16 +01:00
Sylvestre Ledru
f431f58dd8
Bump min rustc to 1.40 (#1909) 2021-03-25 15:28:47 -07:00
Terts Diepraam
23b70001a8
ls: version sort (#1898) 2021-03-25 20:24:53 +01:00
Sivachandran
52997b63fb
pathchk: move from getopts to clap (#1897) 2021-03-25 11:27:34 +01:00
Mekka
99da9ea6ec
Cleanup: Fix grammar in "cp" macro comments. (#1905)
Replaced "they if" with "if they" in the comments above the "prompt_yes" macro.
2021-03-25 10:36:48 +01:00
Sylvestre Ledru
a9786ce528
Reword the "why" a bit (#1903) 2021-03-25 08:07:27 +01:00
Yagiz Degirmenci
63317b3529
ptx: move from getopts to clap (#1893)
* ptx: move from getopts to clap

* chore: delete comment

* chore: fix some clippy warnings
2021-03-24 21:46:17 +01:00
dkg
ffcfcfeef7
tac is "semi-done" because of unimplemented ---regex (#1901) 2021-03-24 17:56:07 +01:00
Sylvestre Ledru
365c230493
refresh cargo.lock with recent updates (#1896) 2021-03-24 08:56:30 +01:00
Marco Satti
9b2ee1ce06
date: change tests to expect failure (#1895)
* date: change tests to expect failure

Although these tests contain valid dates, the parsing logic is not
implemented yet. It should be changed to expect success when
the parsing logic is done.

* date: fix test build errors
2021-03-24 08:33:11 +01:00
Kevin Burke
4873c8a24b
mv: ensure line prints (#1890)
Previously this used `print` instead of `println`, and as a result the
prompt would never appear and the command would hang. The Rust docs
note this about print:

> Note that stdout is frequently line-buffered by default so it may be
> necessary to use io::stdout().flush() to ensure the output is emitted
> immediately.

Changing to `println` fixes the issue.

Fixes #1889.

Co-authored-by: Kevin Burke <kevin@burke.dev>
2021-03-23 21:49:35 +01:00
Alessandro Stoltenberg
b54f0b1ff2
echo: Refactored help message. (#1886) 2021-03-23 11:55:18 +01:00
Yagiz Degirmenci
545fe7d887
feat(unexpand): move from getopts to clap (#1883)
* feat: move unexpand to clap

* chore: allow muliple files

* test: add test fixture, test reading from a file

* test: fix typo on file name, add test for multiple inputs

* chore: use 'success()' instead of asserting

* chore: delete unused variables

* chore: use help instead of long_help, break long line
2021-03-23 09:42:05 +01:00
Yagiz Degirmenci
5e2e2e8ab6
echo: allow leading hyphens (#1887)
* fix: use settings to allow leading hyphen and trailing var arg

fixes: https://github.com/uutils/coreutils/issues/1873

* test: add test cases

* test: add more test cases with different order in hyphen values

* chore: add comment to explain why we need TrailingVarArg
2021-03-23 09:40:05 +01:00
Sylvestre Ledru
9ffcfcd8bf
Merge pull request #1766 from jaggededgedjustice/polish-gnu-tests
* Re-add fixed test

* Stop tests failing on utils that aren't the focus of the test

* Use which to find system utils

* Move timeout to per-test script

Move to a timeout applied to each script and re add the tests that are hanging so they show as failing

* Typo

* Use system timeout command

* Add 4 hour global timeout for protection

* Stop seq-precision.sh causing jams in make

* Shorten the timeout on seq-precision

* Try removing seq-precision

* Keep producing logs even if make hangs

* Add timeouts to other tests that hang

* More tight timeouts

* Remove unbuffer

This causes the make process to hang for some reason, and it itsn't providing any real advantage so it's taken out

* Create *sum binaries for tests

* Use system sha1sum in factor tests

* generate all factor scripts

* fail tests for any binary not built

* Fix tests still failing for the wrong reason

* Revert "Remove unbuffer"

This reverts commit bbce179115.

* Revert "Revert "Remove unbuffer""

This reverts commit 8dae8b798a.

* Use system utils

* clean up sed commands

* clean up workflow script

* Remove use of which to set system binaries

* Don't fail the job if test-suite.log is missing

* Fix typo

* Fix more problems with utils that aren't being tested

* Fix yaml syntax

* Fix test setup
2021-03-22 23:40:14 +01:00
Yagiz Degirmenci
e5ef7486d5
feat: move echo to clap (#1884) 2021-03-22 22:42:14 +01:00
Neculai Balaban
a1b50ae0f4
nohup: move from getopts to clap (#1871)
- changed some error return codes to match GNU implementation
- changed warning/error messages to match GNU nohup
- replaced getopts dependency with clap
- added a test
2021-03-22 20:09:00 +01:00
Yagiz Degirmenci
20dec4cbba
fix: fix clippy warnings (#1876) 2021-03-22 20:08:07 +01:00
James Robson
56da6b4a2c Fix test setup 2021-03-22 17:48:12 +00:00
Terts Diepraam
de3f9b8186
ls: across & commas formats and width parameter (#1869) 2021-03-22 18:24:23 +01:00
Yagiz Degirmenci
d86ee34bc6
tsort: move from getopts to clap (#1867) 2021-03-22 18:16:28 +01:00
Sylvestre Ledru
f593cf53b2
Merge pull request #1870 from nomius10/document_macros
documentation for usual macros
2021-03-22 11:59:11 +01:00
Neculai Balaban
93c7cbe65e documentation for usual macros
- removed repeat_str helper as it's now part of std
- added docstrings for usual macros and test utils
2021-03-22 12:13:38 +02:00
Terts Diepraam
b9662c78a5
ls: possible fix for access time tests (#1866) 2021-03-22 10:14:59 +01:00
Yagiz Degirmenci
27b7552ef4
fix(tail): add support for negative indexing (#1865)
closes: https://github.com/uutils/coreutils/issues/1860
2021-03-22 10:01:54 +01:00
James Robson
027d5e6d9d Fix yaml syntax 2021-03-21 22:31:15 +00:00
Sylvestre Ledru
21be280c5a rustfmt the od changes 2021-03-21 22:22:21 +01:00
James Robson
40677bdc7a Fix more problems with utils that aren't being tested 2021-03-21 20:49:15 +00:00
Yagiz Degirmenci
6c98415340
fix(head): check the whether file exists before unwrap (#1858)
closes https://github.com/uutils/coreutils/issues/1800
2021-03-21 21:27:44 +01:00
Sylvestre Ledru
734368bc92 refresh cargo.lock with recent updates 2021-03-21 17:03:58 +01:00
pedrohjordao
ca8fbc37bf
od: Changes command line parser to clap (#1849) 2021-03-21 16:19:30 +01:00
Yagiz Degirmenci
f60790dd41
chroot: move to clap from getopts (#1792)
+ add tests
2021-03-21 16:18:47 +01:00
Terts Diepraam
25d4a08387
ls: long format author, group and owner (#1850)
This PR adds the options to customize what information is shown in long format regarding author, group & owner. Specifically it adds:
- `--author`: shows the author, which is always the same as the owner. GNU has this feature because GNU/Hurd supports a difference between author and owner, but I don't think Rust supports GNU/Hurd, so I just used the owner.
- `-G` & `--no-group`: hide the group information.
- `-o`: hide the group and use long format (equivalent to `-lG`).
- `-g`: hide the owner and use long format.

The `-o` and `-g` options have some interesting behaviour that I had to account for. Some examples:
- `-og` hides both group and owner.
- `-ol` still hides the group. Same behaviour with variations such as `-o --format=long`, `-gl`, `-g --format=long` and `-ogl`.
- They even retain some information when overridden by another format: `-oCl` (or `-o --format=vertical --format=long`) still hides the group.

My previous solution for handling the behaviour where `-l1` shows the long format did not fit with these additions, so I had to rewrite that as well.

The tests only cover the how many names (author, group and owner) are present in the output, so it can't distinguish between, for example, author & group and group & owner.
2021-03-21 16:18:06 +01:00