Uh oh!
There was an error while loading. Please reload this page.
Rewrite more - #2109
Conversation
sylvestre
commented
Apr 25, 2021
please let me know when it is ready but it is great to see such progress here :) |
AMythicDev
commented
Apr 25, 2021
Sure. I would try to complete it ASAP |
sylvestre
left a comment
There was a problem hiding this comment.
I am aware that it is a draft but here are some initial feedback ;)
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
AMythicDev
commented
Apr 26, 2021
Thanks for telling me that. I would change it in further commits |
AMythicDev
commented
Apr 27, 2021
I have rewrote the basic usable version of more. Although none of the CLI flags are actually implemented and I will address them in a future PR. I think that this PR should be merged before I start working on the CLI part. I see there's a merge conflict which I will resolve probably by tomorrow and squash everything so that we could merge this |
AMythicDev
commented
Apr 28, 2021
This PR is ready for merging. If you have any suggestions, you can comment it down here. I will address them in my next PR |
sylvestre
commented
Apr 28, 2021
Seems that a test is failing on Windows: |
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
sylvestre
left a comment
There was a problem hiding this comment.
it builds fine and bravo for the tests
However:
- more without any arguments cannot be exited?!
Gnu is returning:
LANG=C more
more: bad usage
Try 'more --help' for more information.
more is breaking the display of the terminal (
resetis needed to come back in a normal state)more Makefile. the content isn't rendered correctly.
For example on my system
USEGNU=gmake $*
all:
@$(USEGNU)
.DEFAULT:
@$(USEGNU)
% ╭─sylvestre@pinasil ~/dev/debian/coreutils ‹master*› ╰─$ ./target/release/coreutils more non-existing
is failing with:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', /home/sylvestre/dev/debian/coreutils/src/uu/more/src/more.rs:148:63
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
AMythicDev
commented
May 6, 2021
I think, your issues are probably fixed in the last commit, you could review it again and report if anything goes wrong |
| stdin().read_to_string(&mut buff).unwrap(); | ||
| more(&buff, &mut stdout, true); | ||
| } else { | ||
| show_usage_error!("bad usage"); |
There was a problem hiding this comment.
bad usage? This is the error that GNU is reporting?
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
sylvestre
commented
May 8, 2021
It still breaks the terminal for me. Example with zsh & gnome-terminal: |
sylvestre
commented
May 16, 2021
Sorry but did you test your change?
|
AMythicDev
commented
May 18, 2021
I fixed the issue with broken terminal. Could you recheck that. |
sylvestre
commented
May 18, 2021
Could you decrease the minimal version of crossterm, it fails to build with Rust 1.40 with: |
AMythicDev
commented
May 18, 2021
Sure. I will check that. This might take some time as I would probably have to go through a hit and trial process |
sylvestre
commented
May 18, 2021
To test |
sylvestre
commented
May 18, 2021
Besides that, it looks great :) |
AMythicDev
commented
May 19, 2021
I have downgraded the minimum version of crossterm and everything compiles correctly with Rust 1.40. |
This rewrite is awesome! Sadly, I'm getting some errors on my machine: These seem to be caused by a bug in Apart from this error, really nice job, it looks great when I use the recent versions of @sylvestre Do you think we could set the MSRV to 1.43 to use |
tertsdiepraam
commented
May 29, 2021
I've fixed some things up and I think this can be merged now (if the CI is green). There are a couple of remaining issues that should be dealt with in other PR's:
I'll create issues for these once this is merged. @arijit79 This PR is amazing, thanks! |
The more utility seems fairly incomplete. It does not use any modern terminal library like crossterm or termion Reading from standard input is also not implemented along with other flags that are present in the original GNU
more. This PR intends to rewritemoreusingcrossterm, adding all the missing flags and making it as close to the original more as possibleThere are few differences in the command line interface from the original more like not having the + and - symbols in the
-<number>,+<number>and+/<pattern>options from the original more. This is due to the non-standard way of arguments in GNU more, whichclapdoes not allow building