]> git.0d.be Git - barnard.git/commitdiff
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 9ee58c1289e365f2efd4df08f30b286e275ed390..0e121b35b061cc310cce7150b43075c46ded7b8f 100644 (file)
@@ -1,4 +1,4 @@
-package barnard // import "layeh.com/barnard"
+package main
 
 import (
        "crypto/tls"
 
 import (
        "crypto/tls"
index 2eda4b897e8d35bb7406e8fa1f8e4e7248af0e7e..6f932e5f7e62475107d713e252bc3dc442a2393c 100644 (file)
--- a/client.go
+++ b/client.go
@@ -1,4 +1,4 @@
-package barnard // import "layeh.com/barnard"
+package main
 
 import (
        "fmt"
 
 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 f127caffb3aaf097d8854149b37c7e075c6139f3..98b7b7b4333c9f5eab040b6c158221ae54be611d 100644 (file)
--- a/ui.go
+++ b/ui.go
@@ -1,4 +1,4 @@
-package barnard // import "layeh.com/barnard"
+package main
 
 import (
        "fmt"
 
 import (
        "fmt"
index aa05e26f4927dcbfb552c468e1e94591f2dc21d2..67463b01d78d8b3089d813ceeb9462d415b21d97 100644 (file)
@@ -1,4 +1,4 @@
-package barnard // import "layeh.com/barnard"
+package main
 
 import (
        "layeh.com/barnard/uiterm"
 
 import (
        "layeh.com/barnard/uiterm"
index 62f135302ded915bbd9eaee7a03cfd6b2cf0df04..ba1534d19cf338c58c34a9291bb45376a0ad76ab 100644 (file)
@@ -1,4 +1,4 @@
-package uiterm // import "layeh.com/barnard/uiterm"
+package uiterm
 
 /*
  * Source: https://godoc.org/github.com/nsf/termbox-go
 
 /*
  * 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 a0e79db2eb2932447bc816a91254f888ca02a1fb..a5466b852cdb16c7a26adec42607929ec73e5a96 100644 (file)
@@ -1,4 +1,4 @@
-package uiterm // import "layeh.com/barnard/uiterm"
+package uiterm
 
 /*
  * Source: https://godoc.org/github.com/nsf/termbox-go
 
 /*
  * Source: https://godoc.org/github.com/nsf/termbox-go
index 312b92d74614c460f4e3cf5a29af48bf55ce398a..9ba39e4968d0d65bf298aa8c56b2de14b7397134 100644 (file)
@@ -1,4 +1,4 @@
-package uiterm // import "layeh.com/barnard/uiterm"
+package uiterm
 
 import (
        "strings"
 
 import (
        "strings"
index 9001cdf98e5eae6e0373b8f4c7f628a20c1dc63d..a7d0d4d943c6b8df2f67a5f0f41067669221fd06 100644 (file)
@@ -1,4 +1,4 @@
-package uiterm // import "layeh.com/barnard/uiterm"
+package uiterm
 
 import (
        "strings"
 
 import (
        "strings"
index c799f3d26a376673a448ebf97be3697f96cf0650..d1c155f99918f40cac773b1a8252bd817ff02b08 100644 (file)
@@ -1,4 +1,4 @@
-package uiterm // import "layeh.com/barnard/uiterm"
+package uiterm
 
 import (
        "strings"
 
 import (
        "strings"
index 5cdc618d7665cb69e45d411c81ac463e822270c7..628fbb1b8958092419ebfb111a2c87b16307b5d9 100644 (file)
@@ -1,4 +1,4 @@
-package uiterm // import "layeh.com/barnard/uiterm"
+package uiterm
 
 import (
        "strings"
 
 import (
        "strings"
index 3eb12220a4fcc74e0e01e034c242ec68055ad3b9..31114c7aed1bd15995dccbcadacd1414e038a7b6 100644 (file)
@@ -1,4 +1,4 @@
-package uiterm // import "layeh.com/barnard/uiterm"
+package uiterm
 
 import (
        "errors"
 
 import (
        "errors"
index ff866a21228b56acffee7d48678f1921f3a34026..c63387f247a11f778ea43e6173cd8a48c4fe593d 100644 (file)
@@ -1,4 +1,4 @@
-package uiterm // import "layeh.com/barnard/uiterm"
+package uiterm
 
 type View interface {
        uiInitialize(ui *Ui)
 
 type View interface {
        uiInitialize(ui *Ui)