public class Lookup
extends @Nullable java.lang.Object
Each search criterion is a keyword or regular expression. Lookup outputs each entry that matches all the search criteria.
By default, search criteria are treated as keywords, and each paragraph is treated as an entry — in other words, Lookup prints each paragraph (in any of the files) that contains all the keywords, essentially performing paragraph-wise grep.
A file can contain one or more entries, each of which is a short entry or a long entry.
By default, Lookup searches the file ~/lookup/root. Files can contain comments and can include other files. Comments start with a % sign in the first column. Any comment line is ignored (it is not treated as a blank line for the purpose of separating entries). A file can include another file via a line of the form '\include{filename}'.
The default behavior can be customized by way of command-line options.
The command-line options are as follows:
| Modifier and Type | Field and Description |
|---|---|
static boolean |
case_sensitive
If true, keywords matching is case sensistive.
|
static @Nullable java.lang.String |
comment_re |
static @Regex(value=1) java.util.regex.Pattern |
description_re |
static @Nullable java.lang.String |
entry_file
Specify the colon-separated search list for the file that contains
information to be searched.
|
static @Regex(value=1) java.util.regex.Pattern |
entry_start_re |
static @Regex(value=1) java.util.regex.Pattern |
entry_stop_re |
static boolean |
help
Show detailed help information and exit.
|
static @Nullable java.lang.String |
include_re |
static @Nullable java.lang.Integer |
item_num
Specifies which item to print when there are multiple matches.
|
static boolean |
print_all
By default, if multiple entries are matched, only a synopsis
of each entry is printed.
|
static boolean |
regular_expressions
Specifies that keywords are regular expressions.
|
static boolean |
search_body
Search the body of long entries in addition to the entry's
description.
|
static boolean |
show_location
If true, show the filename/line number of each matching entry
in the output.
|
static boolean |
verbose |
static boolean |
word_match
If true, match a text keyword only as a separate word, not as a
substring of a word.
|
| Constructor and Description |
|---|
Lookup() |
| Modifier and Type | Method and Description |
|---|---|
static @Nullable java.lang.String |
first_line(@Nullable java.lang.String entry)
Returns the first line of entry.
|
static void |
main(java.lang.String[] args)
Look for the specified keywords in the file(s) and print
the corresponding entries.
|
static @Nullable EntryReader.Entry |
old_get_entry(EntryReader reader)
Returns the next entry.
|
public static boolean help
public static boolean verbose
public static @Nullable java.lang.String entry_file
public static boolean search_body
public static boolean regular_expressions
public static boolean case_sensitive
public static boolean word_match
public static boolean print_all
public static @Nullable java.lang.Integer item_num
public static boolean show_location
public static @Regex(value=1) java.util.regex.Pattern entry_start_re
public static @Regex(value=1) java.util.regex.Pattern entry_stop_re
public static @Regex(value=1) java.util.regex.Pattern description_re
public static @Nullable java.lang.String comment_re
public static @Nullable java.lang.String include_re
public static void main(java.lang.String[] args)
throws java.io.IOException
java.io.IOExceptionpublic static @Nullable EntryReader.Entry old_get_entry(EntryReader reader) throws java.io.IOException
java.io.IOExceptionpublic static @Nullable java.lang.String first_line(@Nullable java.lang.String entry)