This brings head & tail in par with all the other utils. French
translation of tail is already using OPTION.
head and tail now have the same print layout as each other: one empty
line before "Mandatory arguments..."
These changes reflect brings the help messages closer to the coreutils
version of head and tail.
When zero bytes or zero lines are requested, there is nothing to read,
so we should not check whether the path is a directory. GNU head
succeeds in this case because it never attempts to open/read the file.
Previously, uutils head would stat the file and reject directories
even when no reading was needed, causing a spurious 'Is a directory'
error.
Fixes#12215
Pager unconditionally wrote ANSI sequences (Attribute::Reverse, Clear,
MoveTo) even when stdout was not a tty, leaking escape codes into pipes.
Gate each on stdout.is_tty() through two helpers and apply them at every
call site: error prompts, multi-file header, screen update, line clear,
pattern highlight, and the status bar.
Bulk rename of the antipattern across 19 test files (136 occurrences).
.no_output() is the established shorthand in the uutests framework
for asserting both empty stdout and empty stderr.
InputType used a 2-variant enum to dispatch read_line/len; len() returned
Result<Option<u64>> because metadata() was called on every invocation.
Replace with a single Input struct holding Box<dyn BufRead> plus a cached
file_size, computed once at construction. Pager::new no longer needs to
return UResult since the only fallible call is gone.
Drive-by: rename page_resize -> resize_page (verb-first matches every
other Pager method); upgrade MULTI_FILE_TOP_PROMPT comment to a doc
comment.