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

- old
+ new

@@ -113,25 +113,29 @@ Henk::Runner.new.list_dumps args, options end end command :"import" do |c| - c.syntax = 'sct henk import <URL>' + c.syntax = 'sct henk import' 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 + begin + dump_url = choose do |menu| + menu.prompt = "Please choose a dump to import:" - dump_url = choose do |menu| - menu.prompt = "Please choose a dump to import:" - - for dump in available_dumps - menu.choice dump + for dump in available_dumps + menu.choice dump + end end + rescue Interrupt + print "\nStopping import" + exit end when 1 dump_url = args.first else UI.error "Expected 0 or 1 arguments, received #{args.length}: #{args}"