Skip to content

Commit

Permalink
Added aliased for frequently used commands
Browse files Browse the repository at this point in the history
  • Loading branch information
id774 committed Jul 13, 2017
1 parent c719f33 commit c5ab07e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/plugins/defaults/standard_commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module Termtter::Client
)

register_command(
:name => :update, :alias => :u,
:name => :update, :aliases => [:u, :a],
:exec => lambda {|arg|
return if arg.empty?
params =
Expand Down Expand Up @@ -71,7 +71,7 @@ module Termtter::Client
)

register_command(
:name => :delete, :aliases =>[:del],
:name => :delete, :aliases =>[:del, :rm],
:exec_proc => lambda {|arg|
id =
case arg
Expand Down Expand Up @@ -327,7 +327,7 @@ def initialize(query)
end

register_command(
:name => :favorite, :aliases => [:fav],
:name => :favorite, :aliases => [:fav, :f],
:exec_proc => lambda {|args|
args.split(' ').each do |arg|
id =
Expand All @@ -339,6 +339,11 @@ def initialize(query)
statuses = Termtter::API.twitter.user_timeline(:screen_name => user_name)
return if statuses.empty?
statuses[0].id
when /^([A-Za-z_]+)/
user_name = $1
statuses = Termtter::API.twitter.user_timeline(:screen_name => user_name)
return if statuses.empty?
statuses[0].id
when %r{twitter.com/(?:\#!/)[A-Za-z0-9_]+/status(?:es)?/\d+},
%r{twitter.com/[A-Za-z0-9_]+}
URI.parse(arg).path.split(%{/}).last.to_i
Expand Down

0 comments on commit c5ab07e

Please sign in to comment.