| Summary: | less: -R is rejected as CLI argument (but works at the env var LESS) | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | avih <avihpit> |
| Component: | Other | Assignee: | unassigned |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | busybox-cvs |
| Priority: | P5 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
Sorry, "R" should be right after "S". I didn't realize the order matters and it did accept -R with the posted patch, just didn't do anything about it. With the R just after S (and before s) - it actually works as expected. I also noticed that flag_change(void) at less.c also doesn't have a reference to 'R', but I don't know what it's used for (it's inside #if ENABLE_FEATURE_LESS_DASHCMD) and whether it should be there or not. Fixed in git, thanks. Thanks for the quick fix. Confirmed working now. |
Using busybox git current master (2328690) on Ubuntu 16.04, with CONFIG_FEATURE_LESS_RAW enabled, running: ./busybox less -R path/to/file Rejects the -R arg and prints the help. Setting the env var LESS=-R does work as expected and filters out raw escapes. It appears that getopt setup is missing "R" . This patch fixes the issue for me: diff --git a/miscutils/less.c b/miscutils/less.c index 97ab1e6..bfdf507 100644 --- a/miscutils/less.c +++ b/miscutils/less.c @@ -1814,7 +1814,7 @@ int less_main(int argc, char **argv) * -s: condense many empty lines to one * (used by some setups for manpage display) */ - getopt32(argv, "EMmN~I" IF_FEATURE_LESS_TRUNCATE("S") /*ignored:*/"s"); + getopt32(argv, "EMmN~I" IF_FEATURE_LESS_TRUNCATE("S") /*ignored:*/"s" IF_FEATURE_LESS_RAW("R")); argv += optind; num_files = argc - optind; files = argv;