Commit graph

58 commits

Author SHA1 Message Date
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
Kourosh
775682508a
more: move from getopts to clap (#1962) 2021-03-30 20:39:58 +02:00
aspen
ed7e24c5b0
uu_more: update nix to 0.13 2021-03-18 08:39:06 -04:00
Sylvestre Ledru
6ad8528b99 update of the uucore dep to 0.0.7 2021-03-07 11:29:38 +01:00
Sylvestre Ledru
6481c5a247 Prepare version 0.0.4 2021-03-07 11:29:38 +01:00
Sylvestre Ledru
262b508b89 update the dep to uucore 0.0.6 2021-02-01 23:55:43 +01:00
Sylvestre Ledru
a807fc623a Update to version 0.0.3 2021-01-22 09:40:38 +01:00
Sylvestre Ledru
b8e886ad1a bump the minimal version of uucore & uucore_procs 2021-01-10 18:27:20 +01:00
Sylvestre Ledru
d9ae043a05
update of the version 0.0.1 => 0.0.2 (#1686) 2021-01-10 18:16:04 +01:00
Sylvestre Ledru
7942a64231 Remove 'extern crate'
Not necessary anymore. See:
https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html#no-more-extern-crate
2020-12-31 15:44:00 +01:00
Roy Ivy III
6539b8c6b9 maint/deps ~ change version specification for dependencies between sub-packages
- refactor internal version specifications to be ">=M.m.p" (where M.m.p is *already published*)

## [why]

Loosening internal version dependencies decreases the coupling between packages such
that packages can be published in a looser order. It allows the packages to be version
updated and published in tandem (ie, by using `cargo workspace ...`). Once published,
the internal versions can then be updated (again, to an *already published* package
version), as needed.
2020-11-08 20:26:46 -06:00
Roy Ivy III
c17307c757 fix ~ update workspace pointers to 'uucore' and 'uucore_procs' 2020-11-08 20:26:46 -06:00
Alex Lyon
110d6844ad
Use an iterator over OsString for uumain()
Additionally, restructure `uname` so that we don't need to find the
iterator's length.
2020-06-16 03:28:02 -05:00
Roy Ivy III
fbbd881ca9 docs ~ reduce sub-crate meta-information keywords to the maximum of five 2020-05-31 15:48:54 -05:00