lib/hackpad/cli/runner.rb in hackpad-cli-0.1.2 vs lib/hackpad/cli/runner.rb in hackpad-cli-0.1.3
- old
+ new
@@ -1,9 +1,8 @@
require 'thor'
require 'yaml'
require_relative 'client'
-require_relative 'version'
module Hackpad
module Cli
class Runner < Thor
@@ -23,11 +22,11 @@
default: false,
desc: 'Displays urls rather than pad ids.'
}
]
- class_option :configdir,
+ class_option :basedir,
aliases: '-c',
default: File.join(ENV['HOME'], '.hackpad-cli/'),
desc: 'Path to the hackpad-cli directory to use.'
class_option :workspace,
@@ -46,10 +45,15 @@
desc 'workspaces', 'Lists configurated hackpad workspaces.'
def workspaces
Hackpad::Cli::Client.new(options).workspaces
end
+ desc 'add', 'Add a new workspace.'
+ def add
+ Hackpad::Cli::Client.new(options).add
+ end
+
desc 'default', 'change the default workspace.'
def default
Hackpad::Cli::Client.new(options).default
end
@@ -88,10 +92,10 @@
Hackpad::Cli::Client.new(options).show pad, format
end
desc 'version', 'Displays the hackpad-cli version.'
def version
- puts Hackpad::Cli::VERSION
+ puts File.read(File.expand_path('../../../../CHANGELOG.md', __FILE__))[/([0-9]+\.[0-9]+\.[0-9]+)/]
end
end
end
end