Skip to content

Commit

Permalink
cmd: prune unused definitionlist functions
Browse files Browse the repository at this point in the history
  • Loading branch information
alrs committed Jul 11, 2020
1 parent 6556a7a commit 9e9a303
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions cmd/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,29 +420,3 @@ func createCancellableContext() context.Context {

return ctx
}

func printDefinitionList(pairs [][]string) {
fprintDefintionList(os.Stdout, pairs)
}

func fprintDefintionList(w io.Writer, pairs [][]string) {
maxLength := 0

for _, pair := range pairs {
if len(pair) != 2 {
panic("each pair must be [2]string")
}
keyLength := len(pair[0])
if keyLength > maxLength {
maxLength = keyLength
}
}

format := fmt.Sprintf("%%-%dv = ", maxLength)

for _, pair := range pairs {
fmt.Fprint(w, " ")
fmt.Fprintf(w, format, pair[0])
fmt.Fprintf(w, "%s\n", pair[1])
}
}

0 comments on commit 9e9a303

Please sign in to comment.