Commit graph

76 commits

Author SHA1 Message Date
Terts Diepraam
53070141c1
all: add format_usage function (#3139)
This should correct the usage strings in both the `--help` and user documentation. Previously, sometimes the name of the utils did not show up correctly.
2022-02-21 17:14:03 +01:00
ndd7xv
1e12c46c24 uucore(memo): replace err_conv with result 2022-02-17 22:43:30 -05:00
ndd7xv
5e790918ef printf: use clap default help and version 2022-02-04 22:07:31 -05:00
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
Sylvestre Ledru
2f6f6867c5
Merge branch 'main' into 2940 2022-01-30 13:33:35 +01:00
Dan Klose
bb7f37e8b4 fix: update itertools 0.8.0 -> 0.10.0
Targets https://github.com/uutils/coreutils/issues/2940

* since versions were mxing versions of x.y and x.y.z I changed all to x.y.z
* minor whitespace formatting
2022-01-29 22:35:51 +00:00
Terts Diepraam
eb82015b23 all: change macros
- Change the main! proc_macro to a bin! macro_rules macro.
- Reexport uucore_procs from uucore
- Make utils to not import uucore_procs directly
- Remove the `syn` dependency and don't parse proc_macro input (hopefully for faster compile times)
2022-01-29 15:26:32 +01:00
Terts Diepraam
9c8e865b55 all: enable infer long arguments in clap 2022-01-29 02:06:29 +01:00
Sylvestre Ledru
5932937952
Merge pull request #2777 from jfinkels/uucore-printf
uucore: move printf::memo module to uucore
2022-01-25 23:22:27 +01:00
Terts Diepraam
55a47f6fc0
Merge pull request #2863 from tertsdiepraam/clap-3
Clap 3
2022-01-20 23:14:52 +01:00
Roy Ivy III
2e251f91f1 0.0.12 2022-01-19 05:35:00 -06:00
Jeffrey Finkelstein
d9afdf0527 uucore: move printf::memo module to uucore
Move the `printf::memo` module to `uucore` so that it can be used by
other programs, not just `printf`. For example, the `-f` option to `seq`
requires parsing and formatting numbers according to the same logic as
`printf`.
2022-01-17 08:46:45 -05:00
Jeffrey Finkelstein
2d66c84413 printf: remove cli module
Remove the cli module from the printf crate and move its functions into
the module tokenize::unescaped_text module, the only place they are
used.
2022-01-17 08:43:36 -05:00
Terts Diepraam
8872485922 Merge branch 'main' into clap-3 2022-01-17 13:25:51 +01:00
Sylvestre Ledru
1fbda8003c coreutils 0.0.8 => 0.0.9, uucore_procs 0.0.7 => 0.0.8, uucore 0.0.10 => 0.0.11 2022-01-16 17:05:48 +01:00
Terts Diepraam
b94809197f printf: clap 3 2022-01-11 19:16:48 +01:00
Jeffrey Finkelstein
c875eef632 printf: return UResult from uumain() function 2021-12-28 21:05:32 -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
Jeffrey Finkelstein
fc77e51b64 printf: derive Default impl for FormatPrimitive 2021-09-10 19:24:59 +02:00
Jan Verbeek
6d346b2307 Replace manual formatting by show_error!()/show_warning!() 2021-09-07 20:15:54 +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
Michael Debertol
5f2335829a refactor ~ revert to single quotes for "Try '{0 --help'"
This is a test expectation for gnu.
2021-08-14 17:22:09 +02:00
Roy Ivy III
c0854000d1 refactor ~ use execution_phrase!() for usage messaging 2021-08-14 14:01:33 +02:00
Roy Ivy III
894d9a068c refactor ~ standardize on 'Try {} --help...' messaging (common markdown-type formatting) 2021-08-14 13:55:11 +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
Jeong YunWon
cc6c2f64b1 clean up fold, hashsum, kill, nl, printf, truncate 2021-06-10 18:39:48 +09:00
Roy Ivy III
750b68a44c refactor/printf ~ fix cargo clippy complaint (clippy::needless_borrow) 2021-06-06 19:28:24 -05:00
Roy Ivy III
b3dd80d39c refactor/printf ~ fix cargo clippy complaint (clippy::needless_borrow) 2021-06-06 19:28:24 -05:00
Roy Ivy III
3f35e0a421 refactor ~ cargo make format 2021-05-31 08:23:58 -05:00
Roy Ivy III
324605c78c refactor/printf ~ polish spelling (comments, names, and exceptions) 2021-05-31 08:23:56 -05:00
Roy Ivy III
9c0c8eb59f change ~ remove 'main.rs' spell-checker exceptions 2021-05-31 08:11:31 -05:00
Sylvestre Ledru
59ea28628b printf: remove useless declaration 2021-05-01 13:11:41 +02:00
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
Sylvestre Ledru
b96f7dbaea
Merge pull request #2087 from pedrohjordao/printf-clap-opts
Changes parameter parsing to clap
2021-04-24 10:02:05 +02:00
Pedro Jordão
158ae35da5 Commented out code removal 2021-04-19 14:21:49 +01:00
Pedro Jordão
01fef70143 Changes parameter parsing to clap
- Uses clap to parse parameters
- Removes of "allow" directive where they are not necessary
- Removes of unused variables
2021-04-17 20:42:05 +01:00
Reto Hablützel
a4253d1254 apply more clippy suggestions from nightly 2021-04-12 20:07:10 +02:00
Reto Hablützel
97d12d6e3c fix trivial warnings without features 2021-04-11 16:05:25 +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
Sylvestre Ledru
dcbcf01665 Fix some clippy warnings 2021-04-01 23:42:30 +02:00
John Eckersberg
08eb56f120 Fix some clippy warnings 2021-03-10 08:42:00 -05:00