From ba69181d4d892aecfc35f9f30fe190d946662284 Mon Sep 17 00:00:00 2001 From: Stefan Majewsky Date: Tue, 4 Apr 2017 22:13:33 +0200 Subject: implement subcommands: remotes, repos, each --- util.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'util.go') diff --git a/util.go b/util.go index a1cea5f..24a1693 100644 --- a/util.go +++ b/util.go @@ -22,9 +22,16 @@ import ( "bufio" "fmt" "os" + "sort" "strings" ) +//ShowSorted sorts the given lines and prints them on stdout. +func ShowSorted(lines []string) { + sort.Strings(lines) + fmt.Println(strings.Join(lines, "\n")) +} + //ShowError prints the given error on stderr if it is non-nil, or returns false otherwise. func ShowError(err error) bool { if err == nil { -- cgit v1.3.1