henk/lib/henk/commands_generator.rb in sct-1.4.0 vs henk/lib/henk/commands_generator.rb in sct-1.5.0

- old
+ new

@@ -103,39 +103,31 @@ c.action do |args, options| Henk::Runner.new.list_clients end end - command :"list-dumps" do |c| - c.syntax = 'sct henk list-dumps' - c.description = 'List the customer dumps currently available for import.' - - c.action do |args, options| - Henk::Runner.new.list_dumps args, options - end - end - command :"import" do |c| - c.syntax = 'sct henk import' + c.syntax = 'sct henk import [<URL>]' c.description = 'Import a customer dump from GCP.' c.action do |args, options| case args.length when 0 puts "Loading available customer dumps...".blue - available_dumps = `sct henk list-dumps`.lines chomp: true + available_dumps = `gsutil ls gs://henk-db-dumps/`.lines chomp: true + begin dump_url = choose do |menu| menu.prompt = "Please choose a dump to import:" for dump in available_dumps menu.choice dump end end rescue Interrupt - print "\nStopping import" - exit + # user pressed Ctrl+C, return in order to exit gracefully + return end when 1 dump_url = args.first else UI.error "Expected 0 or 1 arguments, received #{args.length}: #{args}"