move barnard main package to package root
authorTim Cooper <tim.cooper@layeh.com>
Tue, 8 May 2018 21:00:30 +0000 (18:00 -0300)
committerTim Cooper <tim.cooper@layeh.com>
Tue, 8 May 2018 21:00:30 +0000 (18:00 -0300)
There's only a single executable, so this makes things cleaner

16 files changed:
barnard.go
client.go
cmd/barnard/main.go [deleted file]
doc.go [new file with mode: 0644]
main.go [new file with mode: 0644]
ui.go
ui_tree.go
uiterm/attributes.go
uiterm/doc.go [new file with mode: 0644]
uiterm/keys.go
uiterm/label.go
uiterm/textbox.go
uiterm/textview.go
uiterm/tree.go
uiterm/ui.go
uiterm/view.go

index 9ee58c1..0e121b3 100644 (file)
@@ -1,4 +1,4 @@
-package barnard // import "layeh.com/barnard"
+package main
 
 import (
        "crypto/tls"
index 2eda4b8..6f932e5 100644 (file)
--- a/client.go
+++ b/client.go
@@ -1,4 +1,4 @@
-package barnard // import "layeh.com/barnard"
+package main
 
 import (
        "fmt"
diff --git a/cmd/barnard/main.go b/cmd/barnard/main.go
deleted file mode 100644 (file)
index a426c3e..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-package main // import "layeh.com/barnard/cmd/barnard"
-
-import (
-       "crypto/tls"
-       "flag"
-       "fmt"
-       "os"
-
-       "layeh.com/barnard"
-       "layeh.com/barnard/uiterm"
-       "layeh.com/gumble/gumble"
-       _ "layeh.com/gumble/opus"
-)
-
-func main() {
-       // Command line flags
-       server := flag.String("server", "localhost:64738", "the server to connect to")
-       username := flag.String("username", "", "the username of the client")
-       password := flag.String("password", "", "the password of the server")
-       insecure := flag.Bool("insecure", false, "skip server certificate verification")
-       certificate := flag.String("certificate", "", "PEM encoded certificate and private key")
-
-       flag.Parse()
-
-       // Initialize
-       b := barnard.Barnard{
-               Config: gumble.NewConfig(),
-               Address: *server,
-       }
-
-       b.Config.Username = *username
-       b.Config.Password = *password
-
-       if *insecure {
-               b.TLSConfig.InsecureSkipVerify = true
-       }
-       if *certificate != "" {
-               cert, err := tls.LoadX509KeyPair(*certificate, *certificate)
-               if err != nil {
-                       fmt.Fprintf(os.Stderr, "%s\n", err)
-                       os.Exit(1)
-               }
-               b.TLSConfig.Certificates = append(b.TLSConfig.Certificates, cert)
-       }
-
-       b.Ui = uiterm.New(&b)
-       b.Ui.Run()
-}
diff --git a/doc.go b/doc.go
new file mode 100644 (file)
index 0000000..b00b6f0
--- /dev/null
+++ b/doc.go
@@ -0,0 +1,2 @@
+// barnard is a terminal based client for the Mumble VoIP system.
+package main // import "layeh.com/barnard"
diff --git a/main.go b/main.go
new file mode 100644 (file)
index 0000000..7a779d5
--- /dev/null
+++ b/main.go
@@ -0,0 +1,47 @@
+package main
+
+import (
+       "crypto/tls"
+       "flag"
+       "fmt"
+       "os"
+
+       "layeh.com/barnard/uiterm"
+       "layeh.com/gumble/gumble"
+       _ "layeh.com/gumble/opus"
+)
+
+func main() {
+       // Command line flags
+       server := flag.String("server", "localhost:64738", "the server to connect to")
+       username := flag.String("username", "", "the username of the client")
+       password := flag.String("password", "", "the password of the server")
+       insecure := flag.Bool("insecure", false, "skip server certificate verification")
+       certificate := flag.String("certificate", "", "PEM encoded certificate and private key")
+
+       flag.Parse()
+
+       // Initialize
+       b := Barnard{
+               Config:  gumble.NewConfig(),
+               Address: *server,
+       }
+
+       b.Config.Username = *username
+       b.Config.Password = *password
+
+       if *insecure {
+               b.TLSConfig.InsecureSkipVerify = true
+       }
+       if *certificate != "" {
+               cert, err := tls.LoadX509KeyPair(*certificate, *certificate)
+               if err != nil {
+                       fmt.Fprintf(os.Stderr, "%s\n", err)
+                       os.Exit(1)
+               }
+               b.TLSConfig.Certificates = append(b.TLSConfig.Certificates, cert)
+       }
+
+       b.Ui = uiterm.New(&b)
+       b.Ui.Run()
+}
diff --git a/ui.go b/ui.go
index f127caf..98b7b7b 100644 (file)
--- a/ui.go
+++ b/ui.go
@@ -1,4 +1,4 @@
-package barnard // import "layeh.com/barnard"
+package main
 
 import (
        "fmt"
index aa05e26..67463b0 100644 (file)
@@ -1,4 +1,4 @@
-package barnard // import "layeh.com/barnard"
+package main
 
 import (
        "layeh.com/barnard/uiterm"
index 62f1353..ba1534d 100644 (file)
@@ -1,4 +1,4 @@
-package uiterm // import "layeh.com/barnard/uiterm"
+package uiterm
 
 /*
  * Source: https://godoc.org/github.com/nsf/termbox-go
diff --git a/uiterm/doc.go b/uiterm/doc.go
new file mode 100644 (file)
index 0000000..d26f3c8
--- /dev/null
@@ -0,0 +1 @@
+package uiterm // import "layeh.com/barnard/uiterm"
index a0e79db..a5466b8 100644 (file)
@@ -1,4 +1,4 @@
-package uiterm // import "layeh.com/barnard/uiterm"
+package uiterm
 
 /*
  * Source: https://godoc.org/github.com/nsf/termbox-go
index 312b92d..9ba39e4 100644 (file)
@@ -1,4 +1,4 @@
-package uiterm // import "layeh.com/barnard/uiterm"
+package uiterm
 
 import (
        "strings"
index 9001cdf..a7d0d4d 100644 (file)
@@ -1,4 +1,4 @@
-package uiterm // import "layeh.com/barnard/uiterm"
+package uiterm
 
 import (
        "strings"
index c799f3d..d1c155f 100644 (file)
@@ -1,4 +1,4 @@
-package uiterm // import "layeh.com/barnard/uiterm"
+package uiterm
 
 import (
        "strings"
index 5cdc618..628fbb1 100644 (file)
@@ -1,4 +1,4 @@
-package uiterm // import "layeh.com/barnard/uiterm"
+package uiterm
 
 import (
        "strings"
index 3eb1222..31114c7 100644 (file)
@@ -1,4 +1,4 @@
-package uiterm // import "layeh.com/barnard/uiterm"
+package uiterm
 
 import (
        "errors"
index ff866a2..c63387f 100644 (file)
@@ -1,4 +1,4 @@
-package uiterm // import "layeh.com/barnard/uiterm"
+package uiterm
 
 type View interface {
        uiInitialize(ui *Ui)