-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More implement arguments plain and from line #4950
More implement arguments plain and from line #4950
Conversation
src/uu/more/src/more.rs
Outdated
) -> UResult<()> { | ||
let (cols, mut rows) = terminal::size().unwrap(); | ||
if let Some(number) = options.lines { | ||
rows = number; | ||
} | ||
|
||
let lines = break_buff(buff, usize::from(cols)); | ||
let mut lines = break_buff(buff, usize::from(cols)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to the coverage, the test doesn't go here, would it be possible to test that? thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added a test for it, but I believe the coverage still doesn't detect it because the tests for more
are all contained within an if std::io::stdout().is_terminal()
statement.
Hm, strange, my local |
Yes, you are right. The problem is that clap doesn't currently work with non-Unix options. There's an open issue about this problem at clap-rs/clap#2468 That's why I use what was given in #2320 (comment) |
I think using "normal" arguments is fine, because |
I think there is a bug with paging up. When I run |
b0d8192
to
b6f53aa
Compare
b6f53aa
to
c4c3a35
Compare
Yes, this is a bug. It should now be resolved. |
Thanks! |
Related to #2320
This implements the arguments
plain
andfrom-line
.The
plain
option does nothing because, according to the man page ofmore
, it is written that this option is silently ignored as backwards compatibility.This also fixes two bugs.
The first one occurs when multiple files are given, and a file takes one display to output its content. Now, it displays the next file message if there is another file and only stops if there is none other.
The second one happens with the
squeeze
option. When multiple files are given and the end of the file takes less than a full terminal size to display, it should not start printing the next file.