MCPcopy Index your code
hub / github.com/git-bug/git-bug / showOrgModeFormatter

Function showOrgModeFormatter

commands/bug/bug_show.go:192–268  ·  view source on GitHub ↗
(env *execenv.Env, snapshot *bug.Snapshot)

Source from the content-addressed store, hash-verified

190}
191
192func showOrgModeFormatter(env *execenv.Env, snapshot *bug.Snapshot) error {
193 // Header
194 env.Out.Printf("%s [%s] %s\n",
195 snapshot.Id().Human(),
196 snapshot.Status,
197 snapshot.Title,
198 )
199
200 env.Out.Printf("* Author: %s\n",
201 snapshot.Author.DisplayName(),
202 )
203
204 env.Out.Printf("* Creation Time: %s\n",
205 snapshot.CreateTime.String(),
206 )
207
208 env.Out.Printf("* Last Edit: %s\n",
209 snapshot.EditTime().String(),
210 )
211
212 // Labels
213 var labels = make([]string, len(snapshot.Labels))
214 for i, label := range snapshot.Labels {
215 labels[i] = string(label)
216 }
217
218 env.Out.Printf("* Labels:\n")
219 if len(labels) > 0 {
220 env.Out.Printf("** %s\n",
221 strings.Join(labels, "\n** "),
222 )
223 }
224
225 // Actors
226 var actors = make([]string, len(snapshot.Actors))
227 for i, actor := range snapshot.Actors {
228 actors[i] = fmt.Sprintf("%s %s",
229 actor.Id().Human(),
230 actor.DisplayName(),
231 )
232 }
233
234 env.Out.Printf("* Actors:\n** %s\n",
235 strings.Join(actors, "\n** "),
236 )
237
238 // Participants
239 var participants = make([]string, len(snapshot.Participants))
240 for i, participant := range snapshot.Participants {
241 participants[i] = fmt.Sprintf("%s %s",
242 participant.Id().Human(),
243 participant.DisplayName(),
244 )
245 }
246
247 env.Out.Printf("* Participants:\n** %s\n",
248 strings.Join(participants, "\n** "),
249 )

Callers 1

runBugShowFunction · 0.85

Calls 6

PrintfMethod · 0.65
IdMethod · 0.65
DisplayNameMethod · 0.65
StringMethod · 0.65
HumanMethod · 0.45
EditTimeMethod · 0.45

Tested by

no test coverage detected