Class: Toolshed::Commands::Mysql::Backup

Inherits:
Base
  • Object
show all
Defined in:
lib/toolshed/commands/mysql/backup.rb

Overview

Responsible for handing backup of mysql database

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize, parse, #read_user_input, #read_user_input_body, #read_user_input_password, #read_user_input_title, #use_project_id, #use_ticket_tracker_by_type, #use_ticket_tracker_project_id, #use_ticket_tracker_project_name

Constructor Details

This class inherits a constructor from Toolshed::Commands::Base

Class Method Details

.cli_optionsObject

rubocop:disable MethodLength



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/toolshed/commands/mysql/backup.rb', line 9

def self.cli_options # rubocop:disable MethodLength
  {
    banner: 'Usage: mysql backup [options]',
    options: {
      host: {
        short_on: '-l'
      },
      path: {
        short_on: '-p'
      },
      username: {
        short_on: '-u'
      },
      password: {
        short_on: '-d'
      },
      name: {
        short_on: '-n'
      },
      wait_time: {
        short_on: '-w'
      }
    }
  }
end

Instance Method Details

#execute(_args, options = nil) ⇒ Object



35
36
37
38
39
40
41
# File 'lib/toolshed/commands/mysql/backup.rb', line 35

def execute(_args, options = nil)
  options = options_with_defaults(options)
  Toolshed.logger.info ''
  Toolshed::Databases::Mysql::Backup.new(options).execute
  Toolshed.logger.info ''
  Toolshed.die
end