New applet "less", from Rob Sullivan.

This commit is contained in:
Rob Landley 2005-09-15 19:26:59 +00:00
parent bfd94c4331
commit 9200e79d21
5 changed files with 1329 additions and 0 deletions

View File

@ -359,6 +359,9 @@
#ifdef CONFIG_FEATURE_INITRD
APPLET_NOUSAGE("linuxrc", init_main, _BB_DIR_ROOT, _BB_SUID_NEVER)
#endif
#ifdef CONFIG_LESS
APPLET(less, less_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER)
#endif
#ifdef CONFIG_LN
APPLET(ln, ln_main, _BB_DIR_BIN, _BB_SUID_NEVER)
#endif

View File

@ -1498,6 +1498,22 @@
"$ length Hello\n" \
"5\n"
#define less_trivial_usage \
"[-EMNmh~?] FILE1 FILE2..."
#define less_full_usage \
"View a file or list of files. The position within files can be\n" \
"changed, and files can be manipulated in various ways with the\n" \
"following options:\n\n" \
"\t-E\tQuit once the end of a file is reached\n" \
"\t-M\tDisplay a status line containing the current line numbers\n" \
"\t\tand the percentage through the file\n" \
"\t-N\tPrefix line numbers to each line\n" \
"\t-m\tDisplay a status line containing the percentage through the\n" \
"\t\tfile\n" \
"\t-~\tSuppress ~s displayed when input past the end of the file is\n" \
"\t\treached.\n" \
"\t-h, -?\tDisplay this help message\n"
#define ln_trivial_usage \
"[OPTION] TARGET... LINK_NAME|DIRECTORY"
#define ln_full_usage \

View File

@ -104,6 +104,53 @@ config CONFIG_LAST
help
'last' displays a list of the last users that logged into the system.
config CONFIG_LESS
bool "less"
default n
help
'less' is a pager, meaning that it displays text files. It possesses
a wide array of features, and is an improvement over 'more'.
config CONFIG_FEATURE_LESS_BRACKETS
bool " Enable bracket searching"
default y
depends on CONFIG_LESS
help
This option adds the capability to search for matching left and right
brackets, facilitating programming.
config CONFIG_FEATURE_LESS_FLAGS
bool " Enable extra flags"
default y
depends on CONFIG_LESS
help
The extra flags provided do the following:
The -M flag enables a more sophisticated status line.
The -m flag enables a simpler status line with a percentage.
config CONFIG_FEATURE_LESS_FLAGCS
bool " Enable flag changes"
default n
depends on CONFIG_LESS
help
This enables the ability to change command-line flags within
less itself.
config CONFIG_FEATURE_LESS_MARKS
bool " Enable marks"
default n
depends on CONFIG_LESS
help
Marks enable positions in a file to be stored for easy reference.
config CONFIG_FEATURE_LESS_REGEXP
bool " Enable regular expressions"
default n
depends on CONFIG_LESS
help
Enable regular expressions, allowing complex file searches.
config CONFIG_HDPARM
bool "hdparm"
default n

View File

@ -33,6 +33,7 @@ MISCUTILS-$(CONFIG_DEVFSD) += devfsd.o
MISCUTILS-$(CONFIG_EJECT) += eject.o
MISCUTILS-$(CONFIG_HDPARM) += hdparm.o
MISCUTILS-$(CONFIG_LAST) += last.o
MISCUTILS-${CONFIG_LESS} += less.o
MISCUTILS-$(CONFIG_MAKEDEVS) += makedevs.o
MISCUTILS-$(CONFIG_MOUNTPOINT) += mountpoint.o
MISCUTILS-$(CONFIG_MT) += mt.o

1262
miscutils/less.c Normal file

File diff suppressed because it is too large Load Diff