Commit graph

6978 commits

Author SHA1 Message Date
Nathan
29b613a852 printf: resolve formatting nit in LONGHELP strings
Removed 1 preceeding space for LONGHELP_LEAD and 2 preceeding spaces for LONGHELP_BODY
2022-02-01 22:36:10 -05:00
Nathan
f6174dd946 printf: add description and version
Adds a version number and brief description to the printf utility in the user documentation
2022-02-01 19:28:39 -05:00
Tillmann Rendel
3bfcf78c03
Tweak comment in extensions.json
To flush the highlighting cache.
2022-02-01 23:38:18 +01:00
Tillmann Rendel
d26f6f0f2f
Format cspell config and tweak comments
Mostly to flush the highlighting cache on GitHub, but hopefully it also
improves the file.
2022-02-01 23:36:50 +01:00
Tillmann Rendel
90b96095af
Merge branch 'main' into gitattributes 2022-02-01 23:33:39 +01:00
Tillmann Rendel
587e6d2ded
Move back to .vscode folder 2022-02-01 23:33:24 +01:00
Sam Caldwell
39f8329222 truncate: use map_err instead of unwrap_or_else 2022-02-01 14:13:52 -07:00
Rishi Kumar Ray
f117fd8dd6 added correct format to ABOUT 2022-02-02 02:40:59 +05:30
Sam Caldwell
ea5541db56 truncate: add test_invalid_option 2022-02-01 13:42:50 -07:00
Terts Diepraam
87e582b5e0
Merge pull request #2977 from Dr-Emann/echo_octal_nul
echo: Allow echo with escapes to work with `\0`
2022-02-01 20:13:53 +01:00
Andreas Molzer
c6d5eccf6c false,true: Resolve formatting nit in About 2022-02-01 19:53:25 +01:00
Tillmann Rendel
864b09c9b8
vscode: only recommend rust-analyzer (#3020)
Previously, both RLS and Rust-Analyzer were recommended, now we just recommend RA.
2022-02-01 19:47:49 +01:00
Ivan Majeru
19cc63df9a dd: allow multiple instances of arguments
Correct the behavior of `dd` when multiple arguments are provided.
Before this commit, if the multiple arguments was provided then
the validation error are returned.

For example

```
$ printf '' | ./target/debug/dd status=none status=noxfer
error: The argument '--status=<LEVEL>' was provided more than once, but cannot be used multiple times

USAGE:
    dd [OPTIONS]

For more information try --help
```

The unittest was added for this case.
2022-02-01 20:32:56 +02:00
Tillmann Rendel
420045210c
Try moving .gitattributes to root 2022-02-01 15:27:59 +01:00
Tillmann Rendel
dbbabedec6
Allow comments in VS Code configuration
Since JSON formally cannot contain comments, GitHub highlights comments
in JSON files as errors, but the configuration files for VS Code
in this repository contain comments. This commit configures GitHub to
use a different syntax highlighter for the affected files.
2022-02-01 15:09:51 +01:00
Andreas Molzer
23a544c485 false,true: Implement custom help, version
This avoids hacking around the short options of these command line
arguments that have been introduced by clap. Additionally, we test and
correctly handle the combination of both version and help. The GNU
binary will ignore both arguments in this case while clap would perform
the first one. A test for this edge case was added.
2022-02-01 14:29:26 +01:00
Andreas Molzer
c1e108933f false,true: Align behavior of short flags to GNU 2022-02-01 13:02:22 +01:00
Andreas Molzer
149399c1bf false,true: Add by-util tests for options 2022-02-01 13:02:18 +01:00
Andreas Molzer
dcf177f908 false: Align behavior to true and GNU 2022-02-01 12:04:23 +01:00
Terts Diepraam
08f1199b08 ls: fix flaky test test_ls_io_errors 2022-02-01 10:55:15 +01:00
Andreas Molzer
b29e219e4d true: Rework to return true more often
Now treats recognized command line options and ignores unrecognized
command line options instead of returning a special exit status for
them.

There is one point of interest, which is related to an implementation
detail in GNU `true`. It may return a non-true exit status (in
particular EXIT_FAIL) if writing the diagnostics of a GNU specific
option fails. For example `true --version > /dev/full` would fail and
have exit status 1.

	This behavior was acknowledged in gnu in commit
	<9a6a486e6503520fd2581f2d3356b7149f1b225d>. No further
	justification provided for keeping this quirk.

POSIX knows no such options, and requires an exit status of 0 in all
cases. We replicate GNU here which is a consistency improvement over the
prior implementation. Adds documentation to clarify the intended
behavior more properly.
2022-02-01 09:13:00 +01:00
Sylvestre Ledru
a764fdfb8e
Merge pull request #3005 from jtracey/patch-4
README: mark join as done
2022-02-01 08:57:49 +01:00
Linux User
d762bebc1c update shell scripts according to shellcheck recommendations and minor cleanup 2022-02-01 06:55:11 +00:00
Sam Caldwell
e1f7c774d8 Remove redundant import 2022-01-31 22:59:10 -07:00
Sam Caldwell
6f24166c63 [truncate] handle unused_must_use warning 2022-01-31 22:25:59 -07:00
Sam Caldwell
cd1b5c5748 [truncate] change cli error return code
Exit with status code 1 for argument parsing errors in `truncate`. When
`clap` encounters an error during argument parsing, it exits with status
code 2. This causes some GNU tests to fail since they expect status code
1.
2022-01-31 22:08:59 -07:00
Justin Tracey
482b292ba3
README: mark join as done
Closes #2634.
2022-01-31 22:30:22 +00:00
Narasimha Prasanna HN
1194a8ce53
Fix: Update quick-error crate version from 1.2.3 to 2.0.1 in src/uu/cp (#2947)
fix: update quick-error crate from 1.2.3 to 2.0.1 for src/uu/cp tool, fixes:  #2941
2022-01-31 21:56:47 +01:00
Terts Diepraam
7fc82cd376
Merge pull request #2902 from jtracey/join-non-unicode-sep
join: add support for non-unicode field separators
2022-01-31 21:54:56 +01:00
Terts Diepraam
7477761428
Merge pull request #2882 from jtracey/join-bigfields-compat
join: "support" field numbers larger than usize::MAX
2022-01-31 21:52:13 +01:00
Daniel Eades
4f8d1c5fcf add additional lints 2022-01-31 20:40:47 +01:00
Sylvestre Ledru
4f9ba87c52
Merge pull request #3000 from danieleades/chore/update-clippy-msrv
bump clippy MSRV to match CI MSRV
2022-01-31 20:31:42 +01:00
Daniel Eades
eccd8e1f69 bump clippy MSRV to match CI MSRV 2022-01-31 18:24:56 +01:00
Sylvestre Ledru
829e4fcb2c
Merge pull request #2970 from tertsdiepraam/ls-fix-flaky-test
`ls`: fix flaky test
2022-01-31 14:26:40 +01:00
Terts Diepraam
184b65df20 uucore: allow backup suffix with hyphen value 2022-01-31 12:10:57 +01:00
Sylvestre Ledru
dfc661e8b5
Merge pull request #2975 from douglaz/sha_update
Updated sha libraries
2022-01-31 08:26:49 +01:00
Zachary Dremann
f75466bb31 tests/paste: Add test to avoid trimming extra whitespace 2022-01-30 23:03:11 -05:00
Zachary Dremann
ad4c5d3357 paste: Use a single buffer 2022-01-30 23:01:15 -05:00
Zachary Dremann
85a81d328a paste: Create vec with capacity 2022-01-30 23:01:11 -05:00
Zachary Dremann
ff14f25c34 paste: Reuse output allocation 2022-01-30 23:01:05 -05:00
Zachary Dremann
8905d52279 paste: Write to a locked stdout 2022-01-30 23:01:01 -05:00
Zachary Dremann
c6ec4f8f17 paste: Store delimiters as chars, rather than strings 2022-01-30 23:00:56 -05:00
Zachary Dremann
fa44957a63 paste: Handle unicode delimiters 2022-01-30 23:00:49 -05:00
Jeffrey Finkelstein
b9c2066ee9 uucore: move lines.rs to be a uucore feature
Refactor the `lines.rs` module to be a feature in `uucore`. It was
common to both `head` and `tail`.
2022-01-30 22:15:35 -05:00
Jeffrey Finkelstein
cba0696b90 head: don't add trailing newline to end of file
Prevent `head` from adding a trailing newline to the end of a file
that did not originally have one when using `head --lines=-0`.
2022-01-30 22:04:19 -05:00
Jeffrey Finkelstein
371278e043 truncate: fix typo in docs: "the any" -> "any" 2022-01-30 22:03:13 -05:00
Jeffrey Finkelstein
fe5b537f56 truncate: error when trying to truncate a fifo
Terminate the `truncate` program with an error message when trying to
truncate a named pipe (also known as a fifo).
2022-01-30 22:03:12 -05:00
Jeffrey Finkelstein
83eac9c0a8 head: incorporate "all but last" option into Mode
Refactor the `Mode` enum in the `head.rs` module so that it includes
not only the mode type---lines or bytes---but also whether to read the
first NUM items of that type or all but the last NUM. Before this
commit, these two pieces of information were stored separately. This
made it difficult to read the code through several function calls and
understand at a glance which strategy was being employed.
2022-01-30 22:01:25 -05:00
Justin Tracey
58d65fb953 join: add support for non-unicode field separators
This allows for `-t` to take invalid unicode (but still single-byte) values
on unix-like platforms. Other platforms, which as of the time of this commit
do not support `OsStr::as_bytes()`, could possibly be supported in the future,
but would require design decisions as to what that means.
2022-01-30 20:04:22 -05:00
Zachary Dremann
d6a0b3c920 Allow echo with escapes to work with \0
Testing with gecho on macos outputs a nul character for a \0
2022-01-30 17:24:29 -05:00