mirror of
https://github.com/kidoman/embd
synced 2024-09-21 06:51:41 +02:00
29 lines
444 B
Go
29 lines
444 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/codegangsta/cli"
|
|
"github.com/kidoman/embd"
|
|
)
|
|
|
|
func detect(c *cli.Context) {
|
|
host, rev, err := embd.DetectHost()
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
os.Exit(1)
|
|
}
|
|
fmt.Printf("detected host %v (rev %#x)\n", host, rev)
|
|
}
|
|
|
|
var detectCmd = cli.Command{
|
|
Name: "detect",
|
|
Usage: "detect and display information about the host",
|
|
Action: detect,
|
|
}
|
|
|
|
func init() {
|
|
registerCommand(detectCmd)
|
|
}
|