* [sup-talk] Feature Req: Command line search/display options
@ 2007-10-15 12:49 Marcus Williams
2007-10-15 17:41 ` Christopher Warrington
2007-10-27 3:46 ` William Morgan
0 siblings, 2 replies; 3+ messages in thread
From: Marcus Williams @ 2007-10-15 12:49 UTC (permalink / raw)
Hi -
I posted this in the tracker on RubyForge but then noticed the mail list
so I thought I'd put it here for discussion. I'd like to add some
command line options to search/display messages, because then I can
script using sup outside of sup as it were.
So c&p from tracker:
-------------------------
What would be _really_ nice (and I might have a go at a patch if given
some pointers where to start looking) would besome command line options
to search for messages (printing a list of matches and exiting) and to
display a single message (and exit).
What I'm thinking is something like:
sup --search "some search term"
[someid0] [from] [Subject...................]
[someid1] [from] [Subject...................]
[someid2] [from] [Subject...................]
[someid3] [from] [Subject...................]
[someid.] [from] [Subject...................]
[someidn] [from] [Subject...................]
sup --display someid0
From: blah@blah.com
Subject: This is my subject
The body.
-------------------------
Like I said, I can implement this and submit a patch but it might be
faster if someone pointed me to some relevant places in the source (or
told me it can already be done....)
I'd also quite like the output to be machine parsable as an option (in
the case of the search results anyway) and be able to add/remove labels
from messages/threads, but I thought I'd start with plain text :)
Anyone else find this useful?
Marcus
^ permalink raw reply [flat|nested] 3+ messages in thread
* [sup-talk] Feature Req: Command line search/display options
2007-10-15 12:49 [sup-talk] Feature Req: Command line search/display options Marcus Williams
@ 2007-10-15 17:41 ` Christopher Warrington
2007-10-27 3:46 ` William Morgan
1 sibling, 0 replies; 3+ messages in thread
From: Christopher Warrington @ 2007-10-15 17:41 UTC (permalink / raw)
Excerpts from Marcus Williams's message of Mon Oct 15 07:49:34 -0500 2007:
> Like I said, I can implement this and submit a patch but it might be
> faster if someone pointed me to some relevant places in the source (or
> told me it can already be done....)
For the search code, take a look at bin/sup around line 214.
For message viewing, take a look at lib/sup/modes/thread-view-mode.rb
HTH.
--
Christopher Warrington <chrisw at rice.edu>
Jones College
^ permalink raw reply [flat|nested] 3+ messages in thread
* [sup-talk] Feature Req: Command line search/display options
2007-10-15 12:49 [sup-talk] Feature Req: Command line search/display options Marcus Williams
2007-10-15 17:41 ` Christopher Warrington
@ 2007-10-27 3:46 ` William Morgan
1 sibling, 0 replies; 3+ messages in thread
From: William Morgan @ 2007-10-27 3:46 UTC (permalink / raw)
Excerpts from Marcus Williams's message of Mon Oct 15 05:49:34 -0700 2007:
> I'd like to add some command line options to search/display messages,
> because then I can script using sup outside of sup as it were.
In SVN there's a devel/console.sh, which shows how to hook into Sup
without invoking the interface. Here are some examples:
> sup --search "some search term"
$ sh devel/console.sh
[Fri Oct 26 20:37:55 -0700 2007] loading index...
[Fri Oct 26 20:37:55 -0700 2007] loaded index of 63434 messages
>> Index.index.search_each("potato") { |id, score| m = Index.build_message(id); puts "[#{id}] [#{m.from}] [#{m.subj}]" }
[65155] [William Morgan <wmorgan at masanjin.net>] [potato]
[20758] [Sam Smoot <ssmoot at gmail.com>] [Declaring instance variables dynamically]
[6048] [David Balmain <dbalmain.ml at gmail.com>] [[Ferret-talk] hello, acts_as_ferret questions, any help greatly appreciate]
[6047] [koloa <none at none.com>] [[Ferret-talk] hello, acts_as_ferret questions, any help greatly appreciate]
[2251] [William Morgan <wmorgan at masanjin.net>] [lunch today]
> sup --display someid0
>> puts Index.build_message(6047).raw_message
From ferret-talk-bounces at rubyforge.org Mon Oct 09 08:17:37 2006
[...]
You can submit a patch that adds --search and --display options to
bin/sup, if you like.
--
William <wmorgan-sup at masanjin.net>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-10-27 3:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-15 12:49 [sup-talk] Feature Req: Command line search/display options Marcus Williams
2007-10-15 17:41 ` Christopher Warrington
2007-10-27 3:46 ` William Morgan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox