Permalink
Browse files

add better help messages for consular

  • Loading branch information...
1 parent 23bb374 commit 6cf466f711c97716f0c09ba74f0b50eefafb2924 @achiu committed Oct 9, 2011
Showing with 6 additions and 6 deletions.
  1. +4 −4 lib/consular/cli.rb
  2. +2 −2 spec/cli_spec.rb
View
@@ -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!
@@ -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!
@@ -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'
@@ -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)
View
@@ -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

0 comments on commit 6cf466f

Please sign in to comment.