34 lines
771 B
Ruby
Executable File
34 lines
771 B
Ruby
Executable File
#!/usr/bin/env ruby
|
|
# frozen_string_literal: true
|
|
|
|
require "open3"
|
|
require "thor"
|
|
require_relative "./lib/git_ticket"
|
|
|
|
##
|
|
# CLI interface to the GitTicket class below
|
|
class GitTicketCli < Thor
|
|
desc "shas", "show SHAs for a given ticket ref"
|
|
def shas(ticket_ref)
|
|
git_ticket = GitTicket.new(ticket_ref)
|
|
|
|
git_ticket.shas.each { |sha| puts sha }
|
|
end
|
|
|
|
desc "commits", "show commits for a given ticket ref"
|
|
def commits(ticket_ref)
|
|
git_ticket = GitTicket.new(ticket_ref)
|
|
|
|
git_ticket.commit_messages.each { |message| puts "#{message}\n" }
|
|
end
|
|
|
|
desc "patches", "show patches for a given ticket ref"
|
|
def patches(ticket_ref)
|
|
git_ticket = GitTicket.new(ticket_ref)
|
|
|
|
git_ticket.patches.each { |patch| puts patch }
|
|
end
|
|
end
|
|
|
|
GitTicketCli.start
|