Optimized sorting methods across nodes and profiles

This commit is contained in:
Gregory Kurtzer
2021-04-25 15:43:35 -07:00
parent a321709901
commit 4bc523a052
15 changed files with 266 additions and 234 deletions

View File

@@ -25,7 +25,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
}
if ShowAll {
for _, profile := range profiles {
for _, profile := range node.FilterByName(profiles, args) {
fmt.Printf("################################################################################\n")
fmt.Printf("%-20s %-18s %s\n", "PROFILE NAME", "FIELD", "VALUE")
fmt.Printf("%-20s %-18s %s\n", profile.Id.Get(), "Id", profile.Id.Print())
@@ -59,7 +59,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
fmt.Printf("%-20s %s\n", "PROFILE NAME", "COMMENT/DESCRIPTION")
fmt.Println(strings.Repeat("=", 80))
for _, profile := range profiles {
for _, profile := range node.FilterByName(profiles, args) {
fmt.Printf("%-20s %s\n", profile.Id.Print(), profile.Comment.Print())
}
}