class GHI::Commands::Help
Attributes
command[RW]
Public Class Methods
execute(args, message = nil)
click to toggle source
# File lib/ghi/commands/help.rb, line 4 def self.execute args, message = nil new(args).execute message end
Public Instance Methods
all()
click to toggle source
# File lib/ghi/commands/help.rb, line 50 def all raise 'TODO' end
execute(message = nil)
click to toggle source
# File lib/ghi/commands/help.rb, line 21 def execute message = nil self.command = args.shift if args.first !~ /^-/ if command.nil? && args.empty? puts message if message puts <<EOF The most commonly used ghi commands are: list List your issues (or a repository's) show Show an issue's details open Open (or reopen) an issue close Close an issue edit Modify an existing issue comment Leave a comment on an issue label Create, list, modify, or delete labels assign Assign an issue to yourself (or someone else) milestone Manage project milestones status Determine whether or not issues are enabled for this repo enable Enable issues for the current repo disable Disable issues for the current repo See 'ghi help <command>' for more information on a specific command. EOF exit end options.parse! args.empty? ? %w(-m) : args end
man()
click to toggle source
# File lib/ghi/commands/help.rb, line 54 def man GHI.execute [command, '-h'] # TODO: # exec "man #{['ghi', command].compact.join '-'}" end
options()
click to toggle source
# File lib/ghi/commands/help.rb, line 10 def options OptionParser.new do |opts| opts.banner = 'usage: ghi help [--all] [--man|--web] <command>' opts.separator '' opts.on('-a', '--all', 'print all available commands') { all } opts.on('-m', '--man', 'show man page') { man } opts.on('-w', '--web', 'show manual in web browser') { web } opts.separator '' end end
web()
click to toggle source
# File lib/ghi/commands/help.rb, line 60 def web raise 'TODO' end