()
| 54 | } |
| 55 | |
| 56 | func formattedSearchHelp() { |
| 57 | s := search.SearchHelp() |
| 58 | type help struct{ Name, Description string } |
| 59 | h := []help{} |
| 60 | err := json.Unmarshal([]byte(s), &h) |
| 61 | if err != nil { |
| 62 | cmdmain.Errorf("%v", err) |
| 63 | os.Exit(1) |
| 64 | } |
| 65 | |
| 66 | w := new(tabwriter.Writer) |
| 67 | w.Init(cmdmain.Stdout, 0, 8, 0, '\t', 0) |
| 68 | fmt.Fprintln(w, "Predicates for search expressions") |
| 69 | fmt.Fprintln(w) |
| 70 | fmt.Fprintln(w, "Predicate\tDescription") |
| 71 | fmt.Fprintln(w) |
| 72 | for _, predicate := range h { |
| 73 | desc := strings.Split(predicate.Description, "\n") |
| 74 | for i, d := range desc { |
| 75 | if i == 0 { |
| 76 | fmt.Fprintf(w, "%s\t%s\n", predicate.Name, d) |
| 77 | } else { |
| 78 | fmt.Fprintf(w, "\t%s\n", d) |
| 79 | } |
| 80 | } |
| 81 | } |
| 82 | w.Flush() |
| 83 | } |
no test coverage detected