Skip to content

Commit e5d4729

Browse files
committed
Added ability to show full, untruncated comments with ti show -f/--full [ticid]
1 parent 159f9b3 commit e5d4729

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

lib/ticgit/cli.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def get_editor_message(message_file = nil)
9191
end
9292
end
9393

94-
def ticket_show(t)
94+
def ticket_show(t, more=nil)
9595
days_ago = ((Time.now - t.opened) / (60 * 60 * 24)).round
9696

9797
data = [
@@ -121,7 +121,7 @@ def ticket_show(t)
121121

122122
wrapped = wrapped.split("\n").map{|line| "\t#{line}" }
123123

124-
if wrapped.size > 6
124+
if wrapped.size > 6 and more.nil?
125125
puts wrapped[0, 6].join("\n")
126126
puts "\t** more... **"
127127
else

lib/ticgit/command/show.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@ module TicGit
22
module Command
33
module Show
44
def parser(opts)
5-
opts.banner = "Usage: ti show [ticid]"
5+
opts.banner = "Usage: ti show [--full] [ticid]"
6+
opts.on_head(
7+
"-f", "--full", "Show long comments in full, don't truncate after the 5th line"){|v|
8+
options.full= v
9+
}
610
end
711

812
def execute
913
t = tic.ticket_show(args[0])
10-
ticket_show(t) if t
14+
ticket_show(t, options.full ) if t
1115
end
1216
end
1317
end

0 commit comments

Comments
 (0)