cli: "monitor neighbor" command supports current flag

Signed-off-by: IWASE Yusuke <[email protected]>
This commit is contained in:
IWASE Yusuke
2018-01-12 21:36:57 +09:00
committed by FUJITA Tomonori
parent 568c7aab62
commit a61d468da5
2 changed files with 6 additions and 5 deletions
+3 -2
View File
@@ -993,9 +993,10 @@ func (c *MonitorNeighborStateClient) Recv() (*config.Neighbor, error) {
return api.NewNeighborFromAPIStruct(p)
}
func (cli *Client) MonitorNeighborState(name string) (*MonitorNeighborStateClient, error) {
func (cli *Client) MonitorNeighborState(name string, current bool) (*MonitorNeighborStateClient, error) {
stream, err := cli.cli.MonitorPeerState(context.Background(), &api.Arguments{
Name: name,
Name: name,
Current: current,
})
if err != nil {
return nil, err
+3 -3
View File
@@ -115,7 +115,6 @@ func NewMonitorCmd() *cobra.Command {
},
}
ribCmd.PersistentFlags().StringVarP(&subOpts.AddressFamily, "address-family", "a", "", "address family")
ribCmd.PersistentFlags().BoolVarP(&current, "current", "", false, "dump current contents")
globalCmd := &cobra.Command{
Use: CMD_GLOBAL,
@@ -130,7 +129,7 @@ func NewMonitorCmd() *cobra.Command {
if len(args) > 0 {
name = args[0]
}
stream, err := client.MonitorNeighborState(name)
stream, err := client.MonitorNeighborState(name, current)
if err != nil {
exitWithError(err)
}
@@ -178,7 +177,6 @@ func NewMonitorCmd() *cobra.Command {
},
}
adjInCmd.PersistentFlags().StringVarP(&subOpts.AddressFamily, "address-family", "a", "", "address family")
adjInCmd.PersistentFlags().BoolVarP(&current, "current", "", false, "dump current contents")
monitorCmd := &cobra.Command{
Use: CMD_MONITOR,
@@ -187,5 +185,7 @@ func NewMonitorCmd() *cobra.Command {
monitorCmd.AddCommand(neighborCmd)
monitorCmd.AddCommand(adjInCmd)
monitorCmd.PersistentFlags().BoolVarP(&current, "current", "", false, "dump current contents")
return monitorCmd
}