lib/shelly/cli/file.rb in shelly-0.2.8 vs lib/shelly/cli/file.rb in shelly-0.2.9
- old
+ new
@@ -29,16 +29,20 @@
app.download(relative_source, destination)
rescue Client::ConflictException
say_error "Cloud #{app} is not running. Cannot download files."
end
+ method_option :force, :type => :boolean, :aliases => "-f",
+ :desc => "Skip confirmation question"
desc "delete PATH", "Delete files from persistent data storage"
def delete(path)
app = multiple_clouds(options[:cloud], "file delete #{path}")
- question = "Do you want to permanently delete #{path} (yes/no):"
- delete_files = ask(question)
- exit 1 unless delete_files == "yes"
+ unless options[:force]
+ question = "Do you want to permanently delete #{path} (yes/no):"
+ delete_files = ask(question)
+ exit 1 unless delete_files == "yes"
+ end
app.delete_file(path)
rescue Client::ConflictException
say_error "Cloud #{app} is not running. Cannot delete files."
end