From fe3e175f6e17b06739750a6d5e12d402e402d194 Mon Sep 17 00:00:00 2001 From: "Glenn Y. Rolland" Date: Wed, 29 Oct 2014 23:02:45 +0100 Subject: [PATCH] Use thor for CLI and reuse sshfs-mapper options. --- bin/qasim-cli | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/bin/qasim-cli b/bin/qasim-cli index 606e37b..179908a 100755 --- a/bin/qasim-cli +++ b/bin/qasim-cli @@ -1,20 +1,18 @@ #!/usr/bin/ruby -$DEBUG = true -$VERBOSE = true +#$DEBUG = true +#$VERBOSE = true QASIM_INCLUDE_DIR = "lib" QASIM_DATA_DIR = "." -$:.push QASIM_INCLUDE_DIR -p $:.inspect # # external libraries # require 'bundler/setup' require 'pp' -#require 'thor' +require 'thor' # # project libraries @@ -23,11 +21,28 @@ require '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 @active_maps = nil @@ -41,6 +56,7 @@ module Qasim end + # create default map for each selected map # or default.map if none selected def run_init @@ -83,7 +99,8 @@ module Qasim end end -app = Qasim::Qasim.new -app.run +#app = +Qasim::QasimCli.start(ARGV) +#app.run