# encoding: utf-8 ## # Build the Backup Command Line Interface using Thor module Backup class CLI < Thor include Thor::Actions ## # [Perform] # Performs the backup process. The only required option is the --trigger [-t]. # If the other options (--config-file, --data-path, --cache-path, --tmp-path) aren't specified # they will fallback to the (good) defaults # # If --root-path is given, it will be used as the base path for our defaults, # as well as the base path for any option specified as a relative path. # Any option given as an absolute path will be used "as-is". desc 'perform', "Performs the backup for the specified trigger(s)." long_desc "Performs the backup for the specified trigger(s).\n\n" + "You may perform multiple backups by providing multiple triggers, separated by commas.\n\n" + "Example:\n\s\s$ backup perform --triggers backup1,backup2,backup3,backup4\n\n" + "This will invoke 4 backups, and they will run in the order specified (not asynchronous).\n\n" + "\n\n" + "--root-path may be an absolute path or relative to the current working directory.\n\n" + "To use the current directory, you can use: `--root-path .` (i.e. a period for the argument)" method_option :trigger, :type => :string, :required => true, :aliases => ['-t', '--triggers'], :desc => "Triggers to perform. e.g. 'trigger_a,trigger_b'" method_option :config_file, :type => :string, :default => '', :aliases => '-c', :desc => "Path to your config.rb file. " + "Absolute, or relative to --root-path." method_option :root_path, :type => :string, :default => '', :aliases => '-r', :desc => "Root path to base all relative path on. " + "Absolute or relative to current directory (#{Dir.pwd})." method_option :data_path, :type => :string, :default => '', :aliases => '-d', :desc => "Path to store persisted data (storage 'keep' data). " + "Absolute, or relative to --root-path." method_option :log_path, :type => :string, :default => '', :aliases => '-l', :desc => "Path to store Backup's log file. " + "Absolute, or relative to --root-path." method_option :cache_path, :type => :string, :default => '', :desc => "Path to store Dropbox's cached authorization. " + "Absolute, or relative to --root-path." method_option :tmp_path, :type => :string, :default => '', :desc => "Path to store temporary data during the backup process. " + "Absolute, or relative to --root-path." # Note that :quiet, :syslog and :logfile are specified as :string types, # so the --no-