package main

import (
	"os"

	"github.com/codegangsta/cli"
	"github.com/kidoman/embd"
	"netease_control_center/interfaces/log"
)

func detect(c *cli.Context) {
	host, rev, err := embd.DetectHost()
	if err != nil {
		log.Println(log.ErrorLog, err)
		os.Exit(1)
	}
	log.Printf(log.DebugLog, "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)
}
