mirror of
https://github.com/osrg/gobgp.git
synced 2024-05-11 05:55:10 +00:00
cli: "monitor neighbor" command supports current flag
Signed-off-by: IWASE Yusuke <[email protected]>
This commit is contained in:
committed by
FUJITA Tomonori
parent
568c7aab62
commit
a61d468da5
+3
-2
@@ -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
|
||||
|
||||
@@ -115,7 +115,6 @@ func NewMonitorCmd() *cobra.Command {
|
||||
},
|
||||
}
|
||||
ribCmd.PersistentFlags().StringVarP(&subOpts.AddressFamily, "address-family", "a", "", "address family")
|
||||
ribCmd.PersistentFlags().BoolVarP(¤t, "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(¤t, "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(¤t, "current", "", false, "dump current contents")
|
||||
|
||||
return monitorCmd
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user