aboutsummaryrefslogtreecommitdiffstats
path: root/util.go
diff options
context:
space:
mode:
authorPetter Rasmussen2016-01-23 15:16:53 +0100
committerPetter Rasmussen2016-01-23 15:16:53 +0100
commit6b3da5bcd3891cb6f084a755aea966d7c23f811a (patch)
tree75ac52d08f51fc8d3794fcb4b6e3f8e04fa29a21 /util.go
parentef9d5e6b127e055cac1fd733d49304dd28780ccd (diff)
downloadgdrive-6b3da5bcd3891cb6f084a755aea966d7c23f811a.tar.bz2
Move things around, support subcommand help
Diffstat (limited to 'util.go')
-rw-r--r--util.go22
1 files changed, 22 insertions, 0 deletions
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("")