Skip to content
Snippets Groups Projects
Commit 7ceb32e2 authored by Fabian Seidl's avatar Fabian Seidl
Browse files

adjust output of get command

parent 3342e08f
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !1080. Comments created here will be created in the context of that merge request.
......@@ -55,19 +55,27 @@ var subGetCmd = &cobra.Command{
}
spinner.Success()
data := pterm.TableData{[]string{"SubUUID", "MneID", "MneName", "PndID"}}
data = append(data, []string{resp.Subscriptions.Subid, resp.Subscriptions.Mneid, resp.Subscriptions.MneName, resp.Subscriptions.Pid})
data1 := pterm.TableData{[]string{"SubUUID", "MneID", "MneName", "PndID"}}
data1 = append(data1, []string{resp.Subscriptions.Subid, resp.Subscriptions.Mneid, resp.Subscriptions.MneName, resp.Subscriptions.Pid})
err = pterm.DefaultTable.WithHasHeader().WithData(data1).Render()
if err != nil {
return
}
data = append(data, []string{"Subscribe Options"})
data = append(data, []string{"GnmiMode", "GnmiStreamMode", "Sampleinterval"})
data = append(data, []string{resp.Subscriptions.SubscribeOptions.GnmiMode, resp.Subscriptions.SubscribeOptions.GnmiStreamMode, fmt.Sprint(resp.Subscriptions.SubscribeOptions.SampleInterval)})
pterm.Print(pterm.FgLightCyan.Sprintf("Subscribe Options\n"))
data2 := pterm.TableData{[]string{"GnmiMode", "GnmiStreamMode", "SampleInterval (ns)"}}
data2 = append(data2, []string{resp.Subscriptions.SubscribeOptions.GnmiMode, resp.Subscriptions.SubscribeOptions.GnmiStreamMode, fmt.Sprint(resp.Subscriptions.SubscribeOptions.SampleInterval)})
err = pterm.DefaultTable.WithHasHeader().WithData(data2).Render()
if err != nil {
return
}
data = append(data, []string{"Paths"})
data3 := pterm.TableData{[]string{"Paths"}}
for _, path := range resp.Subscriptions.Paths {
data = append(data, path.Elem)
data3 = append(data3, path.Elem)
}
err = pterm.DefaultTable.WithHasHeader().WithData(data).Render()
err = pterm.DefaultTable.WithHasHeader().WithData(data3).Render()
if err != nil {
return
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment