# File lib/twitter/cli.rb, line 140 def run do_work do if params['username'].given? new_current = Account.find_by_username(params['username'].value) else Account.find(:all, :order => 'username').each do |a| say "#{a.id}. #{a}" end new_current = ask 'Change current account to (enter number): ' do |q| q.validate = /\d+/ end end begin current = Account.set_current(new_current) say "#{current} is now the current account.\n" rescue ActiveRecord::RecordNotFound say "ERROR: Account could not be found. Try again. \n" end end end