refactor: simplify service interface to use tags/rels for all node properties
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
29
cmd/list.go
29
cmd/list.go
@@ -1,6 +1,7 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"axolotl/models"
|
||||
"axolotl/output"
|
||||
"axolotl/service"
|
||||
"fmt"
|
||||
@@ -22,13 +23,27 @@ var listCmd = &cobra.Command{
|
||||
}
|
||||
|
||||
filter := service.ListFilter{
|
||||
Tags: lTags,
|
||||
Status: lStatus,
|
||||
Priority: lPrio,
|
||||
Type: lType,
|
||||
Namespace: lNamespace,
|
||||
Assignee: lAssignee,
|
||||
Mention: lMention,
|
||||
Tags: append([]string{}, lTags...),
|
||||
}
|
||||
|
||||
// Shorthand flags expand to tag prefixes or rel filters.
|
||||
if lStatus != "" {
|
||||
filter.Tags = append(filter.Tags, "_status::"+lStatus)
|
||||
}
|
||||
if lPrio != "" {
|
||||
filter.Tags = append(filter.Tags, "_prio::"+lPrio)
|
||||
}
|
||||
if lType != "" {
|
||||
filter.Tags = append(filter.Tags, "_type::"+lType)
|
||||
}
|
||||
if lNamespace != "" {
|
||||
filter.Rels = append(filter.Rels, service.RelInput{Type: models.RelInNamespace, Target: lNamespace})
|
||||
}
|
||||
if lAssignee != "" {
|
||||
filter.Rels = append(filter.Rels, service.RelInput{Type: models.RelAssignee, Target: lAssignee})
|
||||
}
|
||||
if lMention != "" {
|
||||
filter.Rels = append(filter.Rels, service.RelInput{Type: models.RelMentions, Target: lMention})
|
||||
}
|
||||
|
||||
for _, r := range lRels {
|
||||
|
||||
Reference in New Issue
Block a user