Use thor for CLI and reuse sshfs-mapper options.

This commit is contained in:
Glenn Y. Rolland 2014-10-29 23:02:45 +01:00
parent 6f1ea23906
commit fe3e175f6e

View file

@ -1,20 +1,18 @@
#!/usr/bin/ruby #!/usr/bin/ruby
$DEBUG = true #$DEBUG = true
$VERBOSE = true #$VERBOSE = true
QASIM_INCLUDE_DIR = "lib" QASIM_INCLUDE_DIR = "lib"
QASIM_DATA_DIR = "." QASIM_DATA_DIR = "."
$:.push QASIM_INCLUDE_DIR
p $:.inspect
# #
# external libraries # external libraries
# #
require 'bundler/setup' require 'bundler/setup'
require 'pp' require 'pp'
#require 'thor' require 'thor'
# #
# project libraries # project libraries
@ -23,11 +21,28 @@ require 'qasim'
module Qasim module Qasim
class QasimCli class QasimCli < Thor
desc "init", "initialize user configuration"
def init
raise NotImplementedError
end
desc "list", "list"
def list
raise NotImplementedError
end
desc "mount MAPS", "mount selected maps"
def mount
raise NotImplementedError
end
private
# #
# #
# #
def initialize def initializez
@all_maps = nil @all_maps = nil
@active_maps = nil @active_maps = nil
@ -41,6 +56,7 @@ module Qasim
end end
# create default map for each selected map # create default map for each selected map
# or default.map if none selected # or default.map if none selected
def run_init def run_init
@ -83,7 +99,8 @@ module Qasim
end end
end end
app = Qasim::Qasim.new #app =
app.run Qasim::QasimCli.start(ARGV)
#app.run