lib/tw/app/main.rb in tw-0.0.3 vs lib/tw/app/main.rb in tw-0.1.0

- old
+ new

@@ -1,9 +1,10 @@ require File.expand_path 'opt_parser', File.dirname(__FILE__) require File.expand_path 'cmds', File.dirname(__FILE__) require File.expand_path 'render', File.dirname(__FILE__) +require File.expand_path 'helper', File.dirname(__FILE__) module Tw::App def self.new Main.new @@ -45,10 +46,12 @@ arg :user, 'user account', :alias => :u arg 'user:add', 'add user' arg 'user:list', 'show user list' arg 'user:default', 'set default user' arg :timeline, 'show timeline', :alias => :tl + arg :dm, 'show direct messages' + arg 'dm:to', 'create direct message' arg :search, 'search public timeline', :alias => :s arg :pipe, 'pipe tweet' arg :version, 'show version', :alias => :v arg :help, 'show help', :alias => :h end @@ -78,10 +81,10 @@ res } else message = @parser.argv.join(' ') if (len = message.split(//u).size) > 140 - puts "tweet too long (#{len} chars)" + STDERR.puts "tweet too long (#{len} chars)" on_error else puts "tweet \"#{message}\"? (#{len} chars)" puts '[Y/n]' on_exit if STDIN.gets.strip =~ /^n/i