Using "query" as a verb may be confusing when we'll also refer to
them as nouns with the "<ls|rm|mv>-query" sub commands. "query"
is also many characters to type without tab-completion on what I
expect to be one of the most commonly used sub-commands
Furthermore, "q" is also the common query parameter name used by
our PSGI interface, as is the case with several major web search
engines; so there's an element of familiarity there.
The name "search" was disregarded because "show" could be a
commonly used lei sub-command, too, and typing "se" for
tab-completion may be slow since two-handed typists on QWERTY
keyboards won't be able to use alternating hands.
"f" or "find" could be a possibility here, too; but we're
currently using the term "forget" as a weaker version of
"remove" or "rm", though "ignore" could be substituted for
"forget", perhaps...
Kyle Meyer noted the lack of (proposed) JSON output support
so that's been added to the proposed UI.
# TODO: generate shell completion + help using %CMD and %OPTDESC
# command => [ positional_args, 1-line description, Getopt::Long option spec ]
our %CMD = ( # sorted in order of importance/use:
# TODO: generate shell completion + help using %CMD and %OPTDESC
# command => [ positional_args, 1-line description, Getopt::Long option spec ]
our %CMD = ( # sorted in order of importance/use:
-'query' => [ 'SEARCH_TERMS...', 'search for messages matching terms', qw(
+'q' => [ 'SEARCH_TERMS...', 'search for messages matching terms', qw(
save-as=s output|o=s format|f=s dedupe|d=s thread|t augment|a
sort|s=s@ reverse|r offset=i remote local! extinbox!
since|after=s until|before=s), opt_dash('limit|n=i', '[0-9]+') ],
save-as=s output|o=s format|f=s dedupe|d=s thread|t augment|a
sort|s=s@ reverse|r offset=i remote local! extinbox!
since|after=s until|before=s), opt_dash('limit|n=i', '[0-9]+') ],
'set/unset flags on message(s) from stdin',
qw(stdin| oid=s exact by-mid|mid:s) ],
'forget' => [ '[--stdin|--oid=OID|--by-mid=MID]',
'set/unset flags on message(s) from stdin',
qw(stdin| oid=s exact by-mid|mid:s) ],
'forget' => [ '[--stdin|--oid=OID|--by-mid=MID]',
- 'exclude message(s) on stdin from query results',
+ "exclude message(s) on stdin from `q' search results",
qw(stdin| oid=s exact by-mid|mid:s quiet|q) ],
'purge-mailsource' => [ '{URL_OR_PATHNAME|--all}',
qw(stdin| oid=s exact by-mid|mid:s quiet|q) ],
'purge-mailsource' => [ '{URL_OR_PATHNAME|--all}',
'dedupe|d=s' => ['STRAT|content|oid|mid',
'deduplication strategy'],
'show thread|t' => 'display entire thread a message belongs to',
'dedupe|d=s' => ['STRAT|content|oid|mid',
'deduplication strategy'],
'show thread|t' => 'display entire thread a message belongs to',
'return all messages in the same thread as the actual match(es)',
'augment|a' => 'augment --output destination instead of clobbering',
'return all messages in the same thread as the actual match(es)',
'augment|a' => 'augment --output destination instead of clobbering',
'message/object output format' ],
'mark format|f=s' => $stdin_formats,
'forget format|f=s' => $stdin_formats,
'message/object output format' ],
'mark format|f=s' => $stdin_formats,
'forget format|f=s' => $stdin_formats,
-'query format|f=s' => [ 'OUT|maildir|mboxrd|mboxcl2|mboxcl|html|oid',
+'q format|f=s' => [ 'OUT|maildir|mboxrd|mboxcl2|mboxcl|html|oid|json',
'specify output format, default depends on --output'],
'ls-query format|f=s' => $ls_format,
'ls-extinbox format|f=s' => $ls_format,
'specify output format, default depends on --output'],
'ls-query format|f=s' => $ls_format,
'ls-extinbox format|f=s' => $ls_format,