Class: Git::Daily::Help

Inherits:
Command show all
Defined in:
lib/git-daily/command/help.rb

Instance Method Summary collapse

Methods inherited from Command

branches, clean?, current_branch, develop, has_branch?, has_remote_branch?, #initialize, logurl, master, merged_branches, pull_request_url, release_branches, remote, remote_branch, remotes

Constructor Details

This class inherits a constructor from Git::Daily::Command

Instance Method Details

#helpObject



7
8
9
# File 'lib/git-daily/command/help.rb', line 7

def help
  "help\tShow help (run \"help {subcommand}\" to get more help)"
end

#runObject



11
12
13
14
15
16
17
18
# File 'lib/git-daily/command/help.rb', line 11

def run
  subcommand = ARGV.shift
  if Git::Daily.application.commands.has_key?(subcommand)
    $stderr.puts Git::Daily.application.commands[subcommand].usage
  else
    $stderr.puts usage
  end
end

#usageObject



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/git-daily/command/help.rb', line 20

def usage
  r = <<-EOS
git-daily: command [options]

Usage:

EOS
  Git::Daily.application.commands.keys.sort.each do |key|
    r += "    #{Git::Daily.application.commands[key].help}\n"
  end
  r += "\n"
end