lib/gitlab/cli_helpers.rb
# Confirms command with a desctructive action.
#
# @return [String]
Confirms command with a desctructive action.
Confirms command with a desctructive action .
def confirm_command(cmd)
      if cmd.start_with?('remove_') || cmd.start_with?('delete_')
        puts "Are you sure? (y/n)"
        if %w(y yes).include?($stdin.gets.to_s.strip.downcase)
          puts 'Proceeding..'
        else
          puts 'Command aborted.'
          exit(1)
        end
      end 
    end
def confirm_command ( cmd ) if cmd . start_with? ( 'remove_' ) || cmd . start_with? ( 'delete_' ) puts "Are you sure? (y/n)" if %w( y yes ) . include? ( $stdin . gets . to_s . strip . downcase ) puts 'Proceeding..' else puts 'Command aborted.' exit ( 1 ) end end end
Confirms command with a desctructive action.
Confirms command with a desctructive action .
None
String
cmd
<not_specific>