Module: Lhbackup
- Defined in:
- lib/lhbackup/cli.rb,
lib/lhbackup/backup.rb,
lib/lhbackup/version.rb
Defined Under Namespace
Classes: Backup
Constant Summary collapse
- VERSION =
"0.1.0"
Class Method Summary collapse
Class Method Details
.main ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/lhbackup/cli.rb', line 8 def self.main opts = Trollop:: do version "lhbackup #{VERSION} Copyright (c) 2012 Nathan Youngman" "Lighthouse Backup" opt :account, "Lighthouse account (eg. activereload)", :type => :string, :required => true opt :token, "Token to authenticate with", :type => :string, :required => true opt :output, "Output folder (defaults to account)", :type => :string end folder = opts[:output] || opts[:account] FileUtils.mkdir_p(folder) FileUtils.chdir(folder) Backup.new(opts[:account], opts[:token]).run end |