Refine proboctl catalog selection flags and listing
Require exactly one selection anchor (--id, --linked-banner, --linked-org, or --common-third-party) for common-tracker-pattern reenrich, dropping the catch-all --all; the tracker-type, keyword, and state flags now narrow the anchor's result except when explicit --id values are given. Add --linked-banner, --linked-org, and a tri-state --with-common-third-party to the list command, replacing the separate --linked/--unlinked booleans, and rename --third-party to --common-third-party across both commands. Support these by adding an ID restriction to CommonTrackerPatternFilter so linked-banner/linked-org selections can be intersected with the remaining filters in a single query. Memoize the pg client on the proboctl Factory to avoid a duplicate Prometheus collector registration panic when more than one command path builds a client. Surface timestamps in both listing tables and flag enriched-but-undescribed rows in the displayed enrichment state. Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
11
pkg/proboctl/commonthirdparty/list.go
vendored
11
pkg/proboctl/commonthirdparty/list.go
vendored
@@ -120,9 +120,16 @@ func newCmdList(f *cmdutil.Factory) *cobra.Command {
|
||||
return nil
|
||||
}
|
||||
|
||||
table := clicmdutil.NewTable("ID", "NAME", "SLUG", "CATEGORY")
|
||||
table := clicmdutil.NewTable("ID", "NAME", "SLUG", "CATEGORY", "CREATED", "UPDATED")
|
||||
for _, p := range parties {
|
||||
table.Row(p.ID.String(), p.Name, p.Slug, string(p.Category))
|
||||
table.Row(
|
||||
p.ID.String(),
|
||||
p.Name,
|
||||
p.Slug,
|
||||
string(p.Category),
|
||||
p.CreatedAt.Format("2006-01-02 15:04:05"),
|
||||
p.UpdatedAt.Format("2006-01-02 15:04:05"),
|
||||
)
|
||||
}
|
||||
|
||||
_, _ = fmt.Fprintln(f.IOStreams.Out, table.Render())
|
||||
|
||||
Reference in New Issue
Block a user