lib/ayadn/app.rb in ayadn-2.0.4 vs lib/ayadn/app.rb in ayadn-2.0.5

- old
+ new

@@ -1,11 +1,16 @@ # encoding: utf-8 module Ayadn class App < Thor package_name "Ayadn" - %w{action stream api search descriptions endpoints cnx view workers settings post status extend databases fileops logs pinboard set alias errors blacklist scroll authorize switch mark nicerank debug check nowplaying nowwatching tvshow annotations profile migration}.each { |r| require_relative "#{r}" } + begin + %w{action stream api search descriptions endpoints cnx view workers settings post status extend databases fileops logs pinboard set alias errors blacklist scroll authorize switch mark nicerank debug check nowplaying nowwatching tvshow annotations profile migration}.each { |r| require_relative "#{r}" } + rescue Interrupt + puts "\nExit: stopped by user while launching\n\n" + exit + end ## # These methods are intended to be called from the CLI. desc "timeline", "Show your App.net timeline, aka the Unified Stream (-tl)" @@ -180,11 +185,13 @@ option :reverse, aliases: "-r", type: :boolean, desc: "Reverses the list original order" option :username, aliases: "-u", type: :boolean, desc: "Sort the list by: username" option :name, aliases: "-n", type: :boolean, desc: "Sort the list by: name" option :posts_day, aliases: "-d", type: :boolean, desc: "Sort the list by: posts/day" option :posts, aliases: "-p", type: :boolean, desc: "Sort the list by: total posts" + option :date, aliases: "-t", type: :boolean, desc: "Sort the list by: date (only with 'lastposts' option)" option :compact, aliases: "-k", type: :boolean, desc: "Force the view to be compact if not already" + option :lastpost, aliases: "-l", type: :boolean, desc: "Displays the last post of each user" def followings(*username) Action.new.followings(username, options) end desc "followers @USERNAME", "List users following @username (-fwr)" @@ -536,15 +543,16 @@ desc "blacklist COMMAND (PARAM)", "Manage your blacklist (-K)" map "-K" => :blacklist long_desc Descriptions.blacklist subcommand "blacklist", Blacklist - desc "nowplaying", "Post the current playing track from iTunes or Last.fm (-NP)" + desc "nowplaying", "Post the current playing track from iTunes, Deezer or Last.fm (-NP)" map "-np" => :nowplaying map "-NP" => :nowplaying long_desc Descriptions.nowplaying option :no_url, aliases: "-n", type: :boolean, desc: "Don't append preview or album art at the end of the post" option :lastfm, aliases: "-l", type: :boolean, desc: "Get current track from Last.fm instead of iTunes" + option :deezer, aliases: "-d", type: :boolean, desc: "Get current track from Deezer instead of iTunes" option :hashtag, aliases: "-h", type: :array, desc: "Specify a custom hashtag" option :text, aliases: "-t", type: :array, desc: "Add custom text" option :compact, aliases: "-k", type: :boolean, desc: "Force the view to be compact if not already (after posting)" def nowplaying Action.new.nowplaying(options)