summaryrefslogtreecommitdiff
path: root/util.go
diff options
context:
space:
mode:
authorStefan Majewsky <majewsky@gmx.net>2017-04-04 22:13:33 +0200
committerStefan Majewsky <majewsky@gmx.net>2017-04-04 22:13:33 +0200
commitba69181d4d892aecfc35f9f30fe190d946662284 (patch)
treea278e13d433dc9ade4b19d0ef60a5a5528dbf4ba /util.go
parent5169b2d145b0086516491a35887bfc5eb07be2ae (diff)
downloadgofu-ba69181d4d892aecfc35f9f30fe190d946662284.tar.gz
implement subcommands: remotes, repos, each
Diffstat (limited to 'util.go')
-rw-r--r--util.go7
1 files changed, 7 insertions, 0 deletions
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 {