mirror of
https://github.com/RoganDawes/P4wnP1_aloa.git
synced 2025-03-27 01:51:45 +01:00
Allow CLI client to display events of arbitrary type
This commit is contained in:
parent
8f553db5c3
commit
23077af2a9
@ -2,16 +2,17 @@ package cli_client
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
"../common"
|
||||
"log"
|
||||
)
|
||||
|
||||
var tmpEventID int64
|
||||
|
||||
// usbCmd represents the usb command
|
||||
var evtCmd = &cobra.Command{
|
||||
Use: "EVT",
|
||||
Short: "Receive P4wnP1 service events",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
err := receiveEvent(common.EVT_LOG)
|
||||
err := receiveEvent(tmpEventID)
|
||||
if err != nil { log.Fatal(err)}
|
||||
},
|
||||
}
|
||||
@ -24,4 +25,5 @@ func receiveEvent(eType int64) (err error) {
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(evtCmd)
|
||||
evtCmd.Flags().Int64VarP(&tmpEventID,"event-id", "i", 0,"Listen to events of given ID (0 = Any)")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user