Commit graph

71 commits

Author SHA1 Message Date
Sylvestre Ledru
59e9870c56 Prepare version 0.0.8 2021-10-23 19:21:50 +02:00
Jeffrey Finkelstein
71b7d6b57d more: remove redundant mut from stdout accesses 2021-10-02 09:46:43 -04: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
Sylvestre Ledru
114c9a409c
Merge pull request #2471 from miDeb/real-exe-name
make executable!() return the real executable name
2021-08-22 16:55:06 +02:00
Sylvestre Ledru
8337aeb4d6 bump a few crates to simplify Debian packaging 2021-08-21 23:34:45 +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
c5792c2a0f refactor ~ use util_name!() as clap::app::App name argument for all utils 2021-08-14 13:53:13 +02:00
Jeremy Soller
0474a2eadd
more, tail, test: Update redox_syscall to 0.2 2021-08-06 13:56:20 -06: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
Sylvestre Ledru
1136221f6f rustfmt the recent change 2021-07-04 13:01:31 +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
Hanif Bin Ariffin
083e745976 Simplified page down implementation
Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
2021-06-12 20:34:21 +08:00
Hanif Bin Ariffin
9ed5091be6 Fixed hanging with smaller content
Using 'seq 10 | cargo run -- more' should no longer hangs.

Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
2021-06-12 20:30:15 +08:00
Hanif Bin Ariffin
28c6fad6e3 Now displays the unknown key entered
Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
2021-06-12 18:25:14 +08:00
Hanif Bin Ariffin
ee6419f11c Fixing display when resizing terminal
Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
2021-06-12 18:11:12 +08:00
Hanif Bin Ariffin
63ee42826b Fixed numeric type
1. Its better to bump u16 to usize than the other way round.
2. Highly unlikely to have a terminal with usize rows...makes making sense of the code easier.

Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
2021-06-12 18:02:31 +08:00
Hanif Bin Ariffin
b335e7f2ae Now stops at the last line first. Press down again to go to next file or quit
Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
2021-06-12 17:57:35 +08:00
Terts Diepraam
4abe4c4ac5 Merge branch 'master' into more/rewrite-drawing-logic 2021-06-11 14:03:11 +02:00
Terts Diepraam
960828ba70
Merge pull request #2376 from deantvv/more-option-d
more: Implement option '-d'
2021-06-11 13:49:13 +02:00
Dean Li
dc57e1535e
more: Implement option '-d'
Implement option '-d' (silent mode)

Related to #2320
2021-06-10 19:34:21 +08:00
Terts Diepraam
e73743eb0d more: simpler page_down 2021-06-09 21:56:32 +02:00
Terts Diepraam
40720dc52d more: rewrite drawing logic 2021-06-09 21:00:48 +02:00
Terts Diepraam
be8e5f5f30 use the same spec for atty everywhere 2021-06-09 17:15:42 +02:00
Terts Diepraam
6324df890f
Merge pull request #2357 from deantvv/more-show-next-file
more: Show next file at bottom line
2021-06-06 10:52:03 +02:00
Dean Li
b9fe76ab92
more: Show next file at bottom line
Implement feature requested in #2318.
2021-06-06 09:26:47 +08:00
Terts Diepraam
2760efb01d more: fix test 2021-06-05 14:42:43 +02:00
Terts Diepraam
420e9322ea more: do not accidentically hide last line 2021-06-05 14:07:09 +02:00
Sylvestre Ledru
9712ecb4d5
Merge pull request #2340 from deantvv/more-unicode
more: fix unicode bug
2021-06-04 19:51:32 +02:00
Dean Li
acd290d11f
more: fix unicode bug for breakline
- Use `unicode_segmentation` and `unicode_width` to determine proper `break_line` position.
- Keep track of total_width as suggested by @tertsdiepraam.
- Add unittest for ZWJ unicode case

Related to #2319.
2021-06-04 22:06:27 +08: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
00c02505a1 refactor/more ~ 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
Terts Diepraam
762da0bd37 more: comment out unimplemented arguments 2021-05-29 12:51:47 +02:00
Terts Diepraam
9d17c1fddf more: add todo for unicode width 2021-05-29 12:45:12 +02:00
Terts Diepraam
40ee9023e8 more: simplify main loop 2021-05-29 12:42:46 +02:00
Terts Diepraam
101e55702c more: simplify and fix logic for multiple files 2021-05-29 12:35:03 +02:00
Terts Diepraam
0a2f74fd8e
More: update crossterm dependency 2021-05-28 19:43:03 +02:00
Arijit Dey
1596c65dfd
Downgrade crossterm version 2021-05-18 22:29:59 +05:30
Arijit Dey
7a88df9fb4
Fix broken terminal in tests 2021-05-18 12:42:33 +05:30
Arijit Dey
c930509095
Fix clippy warning 2021-05-16 22:30:46 +05:30
Arijit Dey
22ba21d8ab
Fix bug with terminal getting weird 2021-05-16 22:26:54 +05:30
Arijit Dey
d2ab0dcded
Make a nice error when file does not exist 2021-05-06 22:12:15 +05:30
Arijit Dey
2593b3f2e1
Rewrite the cli usage function
Add crossterm as dependency

Complete the paging portion

Fixed tests

cp: extract linux COW logic into function

cp: add --reflink support for macOS

Fixes #1773

Fix error in Cargo.lock

Quit automatically if not much output is left

Remove unnecessary redox and windows specific code

Handle line wrapping

Put everything according to uutils coding standards

Add support for multiple files

Fix failing test

Use the args argument to get cli arguments

Fix bug where text is repeated multiple times during printing

Add a little prompt

Add a top file prompt for multiple files

Change println in loops to stdout.write and setup terminal only once

Fix bug where all lines were printed in a single row

Remove useless file and fix failing test

Fix another test
2021-04-29 20:23:35 +05:30
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
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
Jamie Quigley
31f5666727
more: add error message if the argument is a directory (#1983) 2021-04-02 22:34:02 +02:00