versions
This commit is contained in:
16
main.go
16
main.go
@@ -9,6 +9,8 @@ import (
|
||||
"git.teamworkapps.com/shortcut/cremote/client"
|
||||
)
|
||||
|
||||
const Version = "2.0.0"
|
||||
|
||||
var (
|
||||
// Global flags
|
||||
daemonHost = flag.String("host", "localhost", "Daemon host")
|
||||
@@ -149,6 +151,19 @@ func main() {
|
||||
|
||||
// Parse the appropriate subcommand
|
||||
switch os.Args[1] {
|
||||
case "version":
|
||||
fmt.Printf("cremote CLI version %s\n", Version)
|
||||
|
||||
// Also get daemon version if possible
|
||||
c := client.NewClient("localhost", 8989)
|
||||
daemonVersion, err := c.GetVersion()
|
||||
if err != nil {
|
||||
fmt.Printf("Daemon: Unable to connect (%v)\n", err)
|
||||
} else {
|
||||
fmt.Printf("Daemon version %s\n", daemonVersion)
|
||||
}
|
||||
return
|
||||
|
||||
case "open-tab":
|
||||
openTabCmd.Parse(os.Args[2:])
|
||||
|
||||
@@ -487,6 +502,7 @@ func main() {
|
||||
func printUsage() {
|
||||
fmt.Println("Usage: cremote <command> [options]")
|
||||
fmt.Println("Commands:")
|
||||
fmt.Println(" version Show version information for CLI and daemon")
|
||||
fmt.Println(" open-tab Open a new tab and return its ID")
|
||||
fmt.Println(" load-url Load a URL in a tab")
|
||||
fmt.Println(" fill-form Fill a form field with a value")
|
||||
|
||||
Reference in New Issue
Block a user