From 6b3da5bcd3891cb6f084a755aea966d7c23f811a Mon Sep 17 00:00:00 2001 From: Petter Rasmussen Date: Sat, 23 Jan 2016 15:16:53 +0100 Subject: Move things around, support subcommand help --- util.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'util.go') diff --git a/util.go b/util.go index 4416696..d40d33e 100644 --- a/util.go +++ b/util.go @@ -22,6 +22,28 @@ func Homedir() string { return os.Getenv("HOME") } +func equal(a, b []string) bool { + if a == nil && b == nil { + return true; + } + + if a == nil || b == nil { + return false; + } + + if len(a) != len(b) { + return false + } + + for i := range a { + if a[i] != b[i] { + return false + } + } + + return true +} + func ExitF(format string, a ...interface{}) { fmt.Fprintf(os.Stderr, format, a...) fmt.Println("") -- cgit v1.2.3