#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../lib/s3_website' class Cfg < Thor desc 'create', 'Create a config file with placeholder values' def create S3Website::Tasks.config_create parent_options[:site] end end class Cli < Thor class_option( :site, :type => :string, :default => '_site', :desc => 'The directory where your website files are' ) option( :headless, :type => :boolean, :desc => 'When headless, s3_website will not require human interaction at any point' ) desc 'push', 'Push local files with the S3 website' long_desc <<-LONGDESC `s3_website push` will upload new and changes files to S3. It will also delete from S3 the files that you no longer have locally. LONGDESC def push S3Website::Tasks.push(options[:site], options[:headless]) end desc 'cfg SUBCOMMAND ...ARGS', 'Operate on the config file' subcommand 'cfg', Cfg end Cli.start(ARGV)