37 lines
549 B
Go
37 lines
549 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
"os"
|
|
|
|
"github.com/urfave/cli"
|
|
)
|
|
|
|
func main() {
|
|
app := cli.NewApp()
|
|
app.Name = "gomie"
|
|
app.Usage = "Simulating a Homie IOT device through Go"
|
|
app.Version = "0.0.1"
|
|
|
|
app.Flags = []cli.Flag{
|
|
cli.StringFlag{
|
|
Name: "mqtt, m",
|
|
Usage: "mqtt connection string",
|
|
Value: "tcp://localhost:1883",
|
|
},
|
|
}
|
|
|
|
app.Commands = []cli.Command{
|
|
{
|
|
Name: "run",
|
|
Usage: "Run a script and report to the Homie server",
|
|
Action: mqttstuff,
|
|
},
|
|
}
|
|
|
|
err := app.Run(os.Args)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
}
|