#!/usr/bin/env ruby require 'optparse' require 'methadone' require 'yaml' require 'new_backup.rb' class App include Methadone::Main include Methadone::CLILogging main do |config_file| # Add args you want: |like,so| options["config_file"] = config_file NewBackup::Main.new(options).run end # supplemental methods here # Declare command-line interface here description "Backup raw and clean data from RDS to S3" # Accept flags via: # on("--flag VAL","Some flag") # options[flag] will contain VAL # # Specify switches via: # on("--[no-]switch","Some switch") on("--debug", "Turn on debug mode") on("--nords", "Don't run the RDS portion") on("--nos3", "Don't run the S3 portion") # # Or, just call OptionParser methods on opts # # Require an argument arg :config_file, "Specify the configuration file path to set options for the backup", "See #{File.dirname(File.dirname(__FILE__))}/sample-config.yml as an example" # # # Make an argument optional # arg :optional_arg, :optional version NewBackup::VERSION use_log_level_option go! end