1
0
mirror of https://github.com/inexio/thola.git synced 2026-10-24 03:08:55 +03:00
Files
thola/cmd/read_interfaces.go
2021-10-21 14:28:44 +02:00

27 lines
684 B
Go

package cmd
import (
"github.com/inexio/thola/internal/request"
"github.com/spf13/cobra"
)
func init() {
addDeviceFlags(readInterfacesCMD)
addInterfaceOptionsFlags(readInterfacesCMD)
readCMD.AddCommand(readInterfacesCMD)
}
var readInterfacesCMD = &cobra.Command{
Use: "interfaces",
Short: "Read out interface information of a device",
Long: "Read out interface information of a device.\n\n" +
"Also reads special values based on the interface type.",
Run: func(cmd *cobra.Command, args []string) {
request := request.ReadInterfacesRequest{
InterfaceOptions: getInterfaceOptions(),
ReadRequest: getReadRequest(args[0]),
}
handleRequest(&request)
},
}