lib/headdesk/cli.rb in headdesk-0.9.0 vs lib/headdesk/cli.rb in headdesk-0.10.0
- old
+ new
@@ -9,10 +9,16 @@
#
# headdesk CLI
#
# :reek:TooManyStatements
class CLI < Thor
+ no_commands do
+ def print_update_message
+ STDOUT.puts format("\e[36m%s\e[0m", "Latest version is #{Headdesk::Versions.latest_version}, please run 'bundle update headdesk'")
+ end
+ end
+
desc 'unpack FILE [DESTINATION]', 'Unpack an APK or IPA to [DESTINATION] or to the current directory'
method_option :analyze, type: :boolean, aliases: '-a'
def unpack(file, destination = nil)
# Make sure the input file exists
unless File.exist?(file)
@@ -88,9 +94,10 @@
if options[:json]
STDOUT.puts report.to_json
else
STDOUT.puts report.to_s
+ print_update_message unless Headdesk::Versions.latest_version?
end
rescue CliError => cli_err
STDERR.puts cli_err.message
CLI.command_help(Thor::Base.shell.new, 'analyze')
return 1