.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "LEI-Q 1" .TH LEI-Q 1 1993-10-02 public-inbox.git "public-inbox user manual" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME lei\-q \- search for messages matching terms .SH SYNOPSIS .IX Header "SYNOPSIS" lei q [OPTIONS] TERM [TERM...] .PP lei q [OPTIONS] (\-\-stdin|\-) .SH DESCRIPTION .IX Header "DESCRIPTION" Search for messages across the lei/store and externals. .SH OPTIONS .IX Header "OPTIONS" .IP \-\-stdin 4 .IX Item "--stdin" Read search terms from stdin. .IP \-\-no\-save 4 .IX Item "--no-save" Do not save the search for \fBlei\-up\fR\|(1). .IP \-\-output=MFOLDER 4 .IX Item "--output=MFOLDER" .PD 0 .IP "\-o MFOLDER" 4 .IX Item "-o MFOLDER" .IP \-\-mfolder=MFOLDER 4 .IX Item "--mfolder=MFOLDER" .PD Warning: this clobbers and overwrites the output destination unless "\-\-augment" is specified. .Sp Destination for results (e.g., \f(CW\*(C`/tmp/results\-Maildir\*(C'\fR, \&\f(CW\*(C`imaps://user@mail.example.com/INBOX.test\*(C'\fR, or \&\f(CW\*(C`mboxcl2:/tmp/results\-mboxcl2\*(C'\fR). The prefix may be a supported protocol: \&\f(CW\*(C`imap://\*(C'\fR or \f(CW\*(C`imaps://\*(C'\fR. URLs requiring authentication use \fBgit\-credential\fR\|(1) to fill in the username and password. .Sp A prefix can specify the format of the output: \f(CW\*(C`maildir\*(C'\fR, \&\f(CW\*(C`mboxrd\*(C'\fR, \f(CW\*(C`mboxcl2\*(C'\fR, \f(CW\*(C`mboxcl\*(C'\fR, \f(CW\*(C`mboxo\*(C'\fR. For a description of mail formats, see \fBlei\-mail\-formats\fR\|(5). .Sp \&\f(CW\*(C`maildir\*(C'\fR is the default for an existing directory or non-existing path. .Sp Default: \f(CW\*(C`\-\*(C'\fR (stdout) .IP \-\-format=FORMAT 4 .IX Item "--format=FORMAT" .PD 0 .IP "\-f FORMAT" 4 .IX Item "-f FORMAT" .PD Format of results to stdout. This option exists as a convenient way to specify the format for the default stdout destination. \&\f(CW\*(C`reply\*(C'\fR, \f(CW\*(C`text\*(C'\fR, \f(CW\*(C`json\*(C'\fR, \f(CW\*(C`jsonl\*(C'\fR, or \f(CW\*(C`concatjson\*(C'\fR are all supported, as are the various mbox variants described in "\-\-output". .Sp When a format isn't specified, it's chosen based on the "\-\-output" destination or prefix. \f(CW\*(C`json\*(C'\fR is used for the default destination (stdout). .Sp Using a \f(CW\*(C`format:\*(C'\fR prefix with the \f(CW\*(C`\-\-output\*(C'\fR destination is preferred when not writing to stdout. .IP \-\-no\-color 4 .IX Item "--no-color" Disable color (for \f(CW\*(C`\-f reply\*(C'\fR and \f(CW\*(C`\-f text\*(C'\fR). .IP \-\-pretty 4 .IX Item "--pretty" Pretty print \f(CW\*(C`json\*(C'\fR or \f(CW\*(C`concatjson\*(C'\fR output. If stdout is opened to a tty and used as the \f(CW\*(C`\-\-output\*(C'\fR destination, \f(CW\*(C`\-\-pretty\*(C'\fR is enabled by default. .IP \-\-mua=COMMAND 4 .IX Item "--mua=COMMAND" A command to run on \f(CW\*(C`\-\-output\*(C'\fR Maildir or mbox (e.g., \f(CW\*(C`mutt \-f %f\*(C'\fR). For a subset of MUAs known to accept a mailbox via \f(CW\*(C`\-f\*(C'\fR, COMMAND can be abbreviated to the name of the program: \f(CW\*(C`mutt\*(C'\fR, \f(CW\*(C`mailx\*(C'\fR, \f(CW\*(C`mail\*(C'\fR, or \f(CW\*(C`neomutt\*(C'\fR. .IP \-\-alert=COMMAND[,COMMAND...] 4 .IX Item "--alert=COMMAND[,COMMAND...]" Run \f(CW\*(C`COMMAND\*(C'\fR after writing to output. \f(CW\*(C`:WINCH\*(C'\fR indicates to send \&\f(CW\*(C`SIGWINCH\*(C'\fR to the \f(CW\*(C`\-\-mua\*(C'\fR process. \f(CW\*(C`:bell\*(C'\fR indicates to print a bell code. Any other value is interpreted as a command to execute as is. .Sp This option may be given multiple times. .Sp Default: \f(CW\*(C`:WINCH,:bell\*(C'\fR when \f(CW\*(C`\-\-mua\*(C'\fR is specified and \f(CW\*(C`\-\-output\*(C'\fR doesn't point to stdout, nothing otherwise. .IP \-\-augment 4 .IX Item "--augment" .PD 0 .IP \-a 4 .IX Item "-a" .PD Augment output destination instead of clobbering it. .IP \-\-no\-import\-before 4 .IX Item "--no-import-before" Do not import keywords before writing to an existing output destination. .IP \-\-threads 4 .IX Item "--threads" .PD 0 .IP \-t 4 .IX Item "-t" .PD Return all messages in the same thread as the actual match(es). .Sp Using this twice (\f(CW\*(C`\-tt\*(C'\fR) sets the \f(CW\*(C`flagged\*(C'\fR (AKA "important") on messages which were actual matches. This is useful to distinguish messages which were direct hits from messages which were merely part of the same thread. .Sp TODO: Warning: this flag may become persistent and saved in lei/store unless an MUA unflags it! (Behavior undecided) .IP \-\-dedupe=STRATEGY 4 .IX Item "--dedupe=STRATEGY" .PD 0 .IP "\-d STRATEGY" 4 .IX Item "-d STRATEGY" .PD Strategy for deduplicating messages: \f(CW\*(C`content\*(C'\fR, \f(CW\*(C`oid\*(C'\fR, \f(CW\*(C`mid\*(C'\fR, or \&\f(CW\*(C`none\*(C'\fR. .Sp Default: \f(CW\*(C`content\*(C'\fR .IP \-\-[no\-]remote 4 .IX Item "--[no-]remote" Whether to include results requiring network access. When local externals are configured, \f(CW\*(C`\-\-remote\*(C'\fR must be explicitly passed to enable reporting of results from remote externals. .IP \-\-no\-local 4 .IX Item "--no-local" Limit operations to those requiring network access. .IP \-\-no\-external 4 .IX Item "--no-external" Don't include results from externals. .IP \-\-include=LOCATION 4 .IX Item "--include=LOCATION" .PD 0 .IP "\-I LOCATION" 4 .IX Item "-I LOCATION" .PD Include specified external in search. This option may be given multiple times. .IP \-\-exclude=LOCATION 4 .IX Item "--exclude=LOCATION" Exclude specified external from search. This option may be given multiple times. .IP \-\-only=LOCATION 4 .IX Item "--only=LOCATION" .PD 0 .IP "\-O LOCATION" 4 .IX Item "-O LOCATION" .PD Use only the specified external for search. This option may be given multiple times, in which case the search uses only the specified set. .IP \-\-globoff 4 .IX Item "--globoff" .PD 0 .IP \-g 4 .IX Item "-g" .PD Do not match locations using \f(CW\*(C`*?\*(C'\fR wildcards and \f(CW\*(C`[]\*(C'\fR ranges. This option applies to \f(CW\*(C`\-\-include\*(C'\fR, \f(CW\*(C`\-\-exclude\*(C'\fR, and \f(CW\*(C`\-\-only\*(C'\fR. .IP \-\-no\-import\-remote 4 .IX Item "--no-import-remote" Disable the default behavior of memoizing remote messages into the local store. .IP \-\-lock=METHOD 4 .IX Item "--lock=METHOD" \&\fBmbox\fR\|(5) locking method(s) to use: \f(CW\*(C`dotlock\*(C'\fR, \f(CW\*(C`fcntl\*(C'\fR, \f(CW\*(C`flock\*(C'\fR or \&\f(CW\*(C`none\*(C'\fR. .Sp Default: fcntl,dotlock .IP \-\-limit=NUMBER 4 .IX Item "--limit=NUMBER" .PD 0 .IP \-NUMBER 4 .IX Item "-NUMBER" .IP "\-n NUMBER" 4 .IX Item "-n NUMBER" .PD Fuzzy limit the number of matches per-local external and lei/store. Messages added by the \-\-threads switch do not count towards this limit, and there is no limit on remote externals. .Sp Default: 10000 .IP \-\-offset=NUMBER 4 .IX Item "--offset=NUMBER" Shift start of search results. .Sp Default: 0 .IP \-\-reverse 4 .IX Item "--reverse" .PD 0 .IP \-r 4 .IX Item "-r" .PD Reverse the results. Note that this applies before \f(CW\*(C`\-\-limit\*(C'\fR. .IP \-\-sort=KEY 4 .IX Item "--sort=KEY" .PD 0 .IP "\-s KEY" 4 .IX Item "-s KEY" .PD Order the results by KEY. Valid keys are \f(CW\*(C`received\*(C'\fR, \f(CW\*(C`relevance\*(C'\fR, and \f(CW\*(C`docid\*(C'\fR. .Sp Default: \f(CW\*(C`received\*(C'\fR .IP \-\-verbose 4 .IX Item "--verbose" .PD 0 .IP \-v 4 .IX Item "-v" .PD Provide more feedback on stderr. .IP \-\-quiet 4 .IX Item "--quiet" .PD 0 .IP \-q 4 .IX Item "-q" .PD Suppress feedback messages. .IP \-\-torsocks=auto|no|yes 4 .IX Item "--torsocks=auto|no|yes" .PD 0 .IP \-\-no\-torsocks 4 .IX Item "--no-torsocks" .PD Whether to wrap \fBgit\fR\|(1) and \fBcurl\fR\|(1) commands with \fBtorsocks\fR\|(1). .Sp Default: \f(CW\*(C`auto\*(C'\fR .IP \-\-proxy=PROTOCOL://HOST[:PORT] 4 .IX Item "--proxy=PROTOCOL://HOST[:PORT]" .SH "SEARCH TERMS" .IX Header "SEARCH TERMS" \&\f(CW\*(C`lei q\*(C'\fR supports the same search prefixes used by HTTP(S) public-inbox instances: .PP .Vb 10 \& s: match within Subject e.g. s:"a quick brown fox" \& d: match date\-time range, git "approxidate" formats supported \& Open\-ended ranges such as \`d:last.week..\*(Aq and \& \`d:..2.days.ago\*(Aq are supported \& b: match within message body, including text attachments \& nq: match non\-quoted text within message body \& q: match quoted text within message body \& n: match filename of attachment(s) \& t: match within the To header \& c: match within the Cc header \& f: match within the From header \& a: match within the To, Cc, and From headers \& tc: match within the To and Cc headers \& l: match contents of the List\-Id header \& bs: match within the Subject and body \& dfn: match filename from diff \& dfa: match diff removed (\-) lines \& dfb: match diff added (+) lines \& dfhh: match diff hunk header context (usually a function name) \& dfctx: match diff context lines \& dfpre: match pre\-image git blob ID \& dfpost: match post\-image git blob ID \& dfblob: match either pre or post\-image git blob ID \& patchid: match \`git patch\-id \-\-stable\*(Aq output \& rt: match received time, like \`d:\*(Aq if sender\*(Aqs clock was correct .Ve .PP Additional search prefixes which only affect the local lei/store: .PP .Vb 2 \& L: match the given label \& kw: match the given keywords .Ve .PP See \fBlei\-tag\fR\|(1) for more info on labels and keywords. .PP Most prefixes are probabilistic, meaning they support stemming and wildcards (\f(CW\*(C`*\*(C'\fR). Ranges (such as \f(CW\*(C`d:\*(C'\fR) and boolean prefixes do not support stemming or wildcards. The upstream Xapian query parser documentation fully explains the query syntax: .SH TIPS .IX Header "TIPS" \&\f(CW\*(C`\-f reply\*(C'\fR is intended to aid in turning a cover letter into a reply (since using \f(CW\*(C`git format\-patch \-\-in\-reply\-to=...\*(C'\fR is tedious). Results (including "From " lines) should be edited and trimmed in your favorite \f(CW$EDITOR\fR before sending. .SH CONTACT .IX Header "CONTACT" Feedback welcome via plain-text mail to .PP The mail archives are hosted at and .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright all contributors .PP License: AGPL\-3.0+ .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBlei\-add\-external\fR\|(1), \fBlei\-lcat\fR\|(1), \fBlei\-up\fR\|(1), Xapian::QueryParser Syntax