Sha256: 198bea89fa4810488f52aef1f68cca66583179353c95d07149ea9201bc1d65c5
Contents?: true
Size: 1.72 KB
Versions: 1
Compression:
Stored size: 1.72 KB
Contents
module Chillfile # CLI handles the command line interface for the `chillfile` binary. It is a `Thor` application. class CLI < ::Thor class_option "path", :default => ".", :aliases => '-p', :banner => "Path to files" class_option "couchdb_server", :default => "http://localhost:5984", :aliases => '-s', :banner => "CouchDB Server URL" class_option "couchdb_database", :default => "chillfile", :aliases => '-db', :banner => "CouchDB Database name" class_option "couchdb_type_key", :default => "type", :aliases => '-tk', :banner => "Attribute name of a CouchDB doc to describe its type" class_option "version", :type => :boolean, :aliases => '-v', :banner => "print version and exit" # create a new instance with the args passed from the command line i.e. ARGV def initialize(*) super cfg = {} cfg["path"] = options[:path] cfg["couchdb_server"] = options[:couchdb_server] cfg["couchdb_database"] = options[:couchdb_database] cfg["couchdb_type_key"] = options[:couchdb_type_key] Chillfile.boot!(cfg) if options[:version] say "chillfile v#{Chillfile::VERSION}", :red exit end end desc 'sync', 'sync filesystem into db' def sync Chillfile.sync! end desc 'fslist', 'json list of files in the filesystem' def fslist say Chillfile.fs_list end desc 'dblist', 'json list of files in the couchdb' def dblist say Chillfile.db_list end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
chillfile-0.0.1 | lib/chillfile/cli.rb |