lib/ayadn/app.rb in ayadn-1.0.13 vs lib/ayadn/app.rb in ayadn-1.1.0
- old
+ new
@@ -52,21 +52,21 @@
option :raw, aliases: "-x", type: :boolean, desc: Descriptions.options_raw
def trending
Action.new.trending(options)
end
- # desc "photos", "Show the Photos Stream (-ph)"
- # map "-ph" => :photos
- # long_desc Descriptions.photos
- # option :scroll, aliases: "-s", type: :boolean, desc: "Scroll the stream"
- # option :new, aliases: "-n", type: :boolean, desc: Descriptions.options_new
- # option :count, aliases: "-c", type: :numeric, desc: Descriptions.options_count
- # option :index, aliases: "-i", type: :boolean, desc: Descriptions.options_index
- # option :raw, aliases: "-x", type: :boolean, desc: Descriptions.options_raw
- # def photos
- # Action.new.photos(options)
- # end
+ desc "photos", "Show the Photos Stream (-ph)"
+ map "-ph" => :photos
+ long_desc Descriptions.photos
+ option :scroll, aliases: "-s", type: :boolean, desc: "Scroll the stream"
+ option :new, aliases: "-n", type: :boolean, desc: Descriptions.options_new
+ option :count, aliases: "-c", type: :numeric, desc: Descriptions.options_count
+ option :index, aliases: "-i", type: :boolean, desc: Descriptions.options_index
+ option :raw, aliases: "-x", type: :boolean, desc: Descriptions.options_raw
+ def photos
+ Action.new.photos(options)
+ end
desc "conversations", "Show the Conversations Stream (-cq)"
map "-cq" => :conversations
long_desc Descriptions.conversations
option :scroll, aliases: "-s", type: :boolean, desc: "Scroll the stream"
@@ -112,10 +112,11 @@
map "-was" => :whatstarred
long_desc Descriptions.whatstarred
option :count, aliases: "-c", type: :numeric, desc: Descriptions.options_count
option :index, aliases: "-i", type: :boolean, desc: Descriptions.options_index
option :raw, aliases: "-x", type: :boolean, desc: Descriptions.options_raw
+ option :extract, aliases: "-e", type: :boolean, desc: Descriptions.options_extract
def whatstarred(*username)
Action.new.whatstarred(username, options)
end
desc "whoreposted POST", "List users who reposted a post (-wor)"
@@ -179,29 +180,32 @@
desc "hashtag HASHTAG", "Show recent posts containing #HASHTAG (-t)"
map "-t" => :hashtag
long_desc Descriptions.hashtag
option :raw, aliases: "-x", type: :boolean, desc: Descriptions.options_raw
+ option :extract, aliases: "-e", type: :boolean, desc: Descriptions.options_extract
def hashtag(hashtag)
Action.new.hashtag(hashtag, options)
end
desc "search WORD(S)", "Show recents posts containing WORD(S) (-s)"
map "-s" => :search
long_desc Descriptions.search
option :count, aliases: "-c", type: :numeric, desc: Descriptions.options_count
option :index, aliases: "-i", type: :boolean, desc: Descriptions.options_index
option :raw, aliases: "-x", type: :boolean, desc: Descriptions.options_raw
+ option :extract, aliases: "-e", type: :boolean, desc: Descriptions.options_extract
def search(*words)
Action.new.search(words.join(","), options)
end
desc "settings", "List current Ayadn settings (-sg)"
map "-sg" => :settings
long_desc Descriptions.settings
+ option :raw, aliases: "-x", type: :boolean, desc: "Outputs the raw list in JSON"
def settings
- Action.new.view_settings
+ Action.new.view_settings(options)
end
desc "userinfo @USERNAME", "Show detailed informations about @username (-ui)"
map "-ui" => :userinfo
long_desc Descriptions.userinfo
@@ -233,10 +237,17 @@
long_desc Descriptions.delete
def delete(post_id)
Action.new.delete(post_id)
end
+ desc "delete_m CHANNEL MESSAGE", "Delete a message (-DM)"
+ map "-DM" => :delete_m
+ long_desc Descriptions.delete_m
+ def delete_m(*args)
+ Action.new.delete_m(args)
+ end
+
desc "unfollow @USERNAME", "Unfollow @username (-UF)"
map "-UF" => :unfollow
long_desc Descriptions.unfollow
def unfollow(*username)
Action.new.unfollow(username)
@@ -423,9 +434,20 @@
unless options[:list]
Switch.new.switch(username)
else
Switch.new.list
end
+ end
+
+ desc "version", "Show the current Ayadn version (-v)"
+ map "-v" => :version
+ def version
+ puts "\nAYADN\n".color(:red)
+ puts "Version:\t".color(:cyan) + "#{VERSION}\n".color(:green)
+ puts "Changelog:\t".color(:cyan) + "https://github.com/ericdke/na/blob/master/CHANGELOG.md\n".color(:yellow)
+ puts "Readme:\t\t".color(:cyan) + "https://github.com/ericdke/na/blob/master/README.md".color(:yellow)
+ puts "Manual:\t\t".color(:cyan) + "https://github.com/ericdke/na/blob/master/MANUAL.md".color(:yellow)
+ puts "\n"
end
end
end