From: Rich Lane <rlane@club.cc.cmu.edu>
To: sup-devel@rubyforge.org
Subject: [sup-devel] [PATCH 3/3] simplify sup-add
Date: Sun, 17 Jan 2010 10:50:47 -0800 [thread overview]
Message-ID: <1263754247-20979-4-git-send-email-rlane@club.cc.cmu.edu> (raw)
In-Reply-To: <1263754247-20979-3-git-send-email-rlane@club.cc.cmu.edu>
---
bin/sup-add | 40 ----------------------------------------
1 files changed, 0 insertions(+), 40 deletions(-)
diff --git a/bin/sup-add b/bin/sup-add
index 059a4e2..e354ea8 100755
--- a/bin/sup-add
+++ b/bin/sup-add
@@ -30,50 +30,10 @@ EOS
opt :unusual, "Do not automatically poll these sources for new messages."
opt :labels, "A comma-separated set of labels to apply to all messages from this source", :type => String
opt :force_new, "Create a new account for this source, even if one already exists."
- opt :force_account, "Reuse previously defined account user@hostname.", :type => String
end
Trollop::die "require one or more sources" if ARGV.empty?
-## for sources that require login information, prompt the user for
-## that. also provide a list of previously-defined login info to
-## choose from, if any.
-def get_login_info uri, sources
- uri = URI(uri)
- accounts = sources.map do |s|
- next unless s.respond_to?(:username)
- suri = URI(s.uri)
- [suri.host, s.username, s.password]
- end.compact.uniq.sort_by { |h, u, p| h == uri.host ? 0 : 1 }
-
- username, password = nil, nil
- unless accounts.empty? || $opts[:force_new]
- if $opts[:force_account]
- host, username, password = accounts.find { |h, u, p| $opts[:force_account] == "#{u}@#{h}" }
- unless username && password
- say "No previous account #{$opts[:force_account].inspect} found."
- end
- else
- say "Would you like to use the same account as for a previous source for #{uri}?"
- choose do |menu|
- accounts.each do |host, olduser, oldpw|
- menu.choice("Use the account info for #{olduser}@#{host}") { username, password = olduser, oldpw }
- end
- menu.choice("Use a new account") { }
- menu.prompt = "Account selection? "
- end
- end
- end
-
- unless username && password
- username = ask("Username for #{uri.host}: ");
- password = ask("Password for #{uri.host}: ") { |q| q.echo = false }
- puts # why?
- end
-
- [username, password]
-end
-
$terminal.wrap_at = :auto
Redwood::start
index = Redwood::Index.init
--
1.6.3.3
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
next prev parent reply other threads:[~2010-01-17 18:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-17 18:50 [sup-devel] RFC: Nuke remote sources Rich Lane
2010-01-17 18:50 ` [sup-devel] [PATCH 1/3] remove mbox+ssh source Rich Lane
2010-01-17 18:50 ` [sup-devel] [PATCH 2/3] remove imap source Rich Lane
2010-01-17 18:50 ` Rich Lane [this message]
2010-01-17 20:39 ` [sup-devel] RFC: Nuke remote sources William Morgan
2010-01-18 17:06 ` William Morgan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1263754247-20979-4-git-send-email-rlane@club.cc.cmu.edu \
--to=rlane@club.cc.cmu.edu \
--cc=sup-devel@rubyforge.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox