Skip to content

Commit

Permalink
add better help messages for consular
Browse files Browse the repository at this point in the history
  • Loading branch information
achiurizo committed Oct 9, 2011
1 parent 23bb374 commit 6cf466f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions lib/consular/cli.rb
Expand Up @@ -25,7 +25,7 @@ def self.source_root; File.expand_path('../../', __FILE__); end
# Consular::CLI.start ['start', '-r=/tmp'] # /tmp/Termfile
#
# @api public
desc 'start PROJECT', 'runs the consular script'
desc 'start [PROJECT]', 'runs the consular script. ex: `consular start` or `consular start foobar`'
method_option :root, :type => :string, :default => '.', :aliases => '-r'
def start(project = nil)
valid_core.new(termfile_path(project)).process!
Expand All @@ -49,7 +49,7 @@ def start(project = nil)
# Consular::CLI.start ['setup', '-r=/tmp'] # /tmp/Termfile
#
# @api public
desc 'setup PROJECT', 'run the consular script setup'
desc 'setup [PROJECT]', 'run the consular script setup. ex: `consular setup` or `consular setup foobar`'
method_option :root, :type => :string, :default => '.', :aliases => '-r'
def setup(project = nil)
valid_core.new(termfile_path(project)).setup!
Expand Down Expand Up @@ -100,7 +100,7 @@ def init
# Consular::CLI.start ['edit', '-r=/tmp']
#
# @api public
desc 'edit PROJECT', 'opens the Termfile to edit'
desc 'edit [PROJECT]', 'opens the Termfile to edit. ex: `consular edit` or `consular edit foobar`'
method_option :root, :type => :string, :default => '.', :aliases => '-r'
method_option :editor, :type => :string, :default => nil, :aliases => '-e'
method_option :capture, :type => :boolean, :default => false, :aliases => '-c'
Expand All @@ -126,7 +126,7 @@ def edit(project = nil)
# Consular::CLI.start ['delete', '-r=/tmp']
#
# @api public
desc 'delete PROJECT', 'delete the Termfile script'
desc 'delete [PROJECT]', 'delete the Termfile script. ex: `consular delete` or `consular delete foobar`'
method_option :root, :type => :string, :default => '.', :aliases => '-r'
def delete(project = nil)
path = termfile_path(project)
Expand Down
4 changes: 2 additions & 2 deletions spec/cli_spec.rb
Expand Up @@ -26,9 +26,9 @@ def setup!; puts('setup'); end
it "displays help" do
output = capture_io { Consular::CLI.start ['-h'] }.join('')

assert_match /start PROJECT/, output
assert_match /start \[PROJECT\]/, output
assert_match /init/, output
assert_match /edit PROJECT/, output
assert_match /edit \[PROJECT\]/, output
end

it "lists out all global scripts" do
Expand Down

0 comments on commit 6cf466f

Please sign in to comment.