Skip to content

Commit

Permalink
add one letter aliases server command and to formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
cowboyd committed Jun 2, 2010
1 parent 998072c commit 8acca33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/hudson/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ def self.common_options

desc "server [options]", "run a hudson server"
method_option :home, :type => :string, :default => File.join(ENV['HOME'], ".hudson", "server"), :banner => "PATH", :desc => "use this directory to store server data"
method_option :port, :type => :numeric, :default => 3001, :desc => "run hudson server on this port"
method_option :control, :type => :numeric, :default => 3002, :desc => "set the shutdown/control port"
method_option :port, :type => :numeric, :default => 3001, :desc => "run hudson server on this port", :aliases => "-p"
method_option :control, :type => :numeric, :default => 3002, :desc => "set the shutdown/control port", :aliases => "-c"
method_option :daemon, :type => :boolean, :default => false, :desc => "fork into background and run as a daemon"
method_option :kill, :type => :boolean, :desc => "send shutdown signal to control port"
method_option :kill, :type => :boolean, :desc => "send shutdown signal to control port", :aliases => "-k"
method_option :logfile, :type => :string, :banner => "PATH", :desc => "redirect log messages to this file"
def server
if options[:kill]
Expand Down
5 changes: 3 additions & 2 deletions lib/hudson/cli/formatting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def task_help(shell, task_name)

def print_options(shell, options, grp = nil)
return if options.empty?
# shell.say "Options:"
table = options.map do |option|
prototype = if option.default
" [#{option.default}]"
Expand All @@ -30,9 +29,11 @@ def print_options(shell, options, grp = nil)
else
" [#{option.banner}]"
end
["--#{option.name}#{prototype}", "\t",option.description]
aliases = option.aliases.empty? ? "" : option.aliases.join(" ") + ","
[aliases, "--#{option.name}#{prototype}", "\t",option.description]
end
shell.print_table(table, :ident => 2)
shell.say
end
end

Expand Down

0 comments on commit 8acca33

Please sign in to comment.