refactor: simplify db and cmd flags, reduce code duplication
- Abstract property flags into addPropertyFlags in cmd/root.go and apply to commands - Remove unused GetUserByUsername from db.go (it's redundant with service.resolveUserIDByName) - Use configured user in WithMentions directly in inbox command - Refactor resolve methods in node_service_sqlite.go to reduce duplication
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var lDummy, lAssignee string
|
||||
var lAssignee string
|
||||
var lTags []string
|
||||
|
||||
var listCmd = &cobra.Command{
|
||||
@@ -32,11 +32,8 @@ var listCmd = &cobra.Command{
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(listCmd)
|
||||
addPropertyFlags(listCmd)
|
||||
f := listCmd.Flags()
|
||||
f.StringVar(&lDummy, "type", "", "")
|
||||
f.StringVar(&lDummy, "status", "", "")
|
||||
f.StringVar(&lDummy, "prio", "", "")
|
||||
f.StringVar(&lDummy, "namespace", "", "")
|
||||
f.StringVar(&lAssignee, "assignee", "", "")
|
||||
f.StringArrayVar(&lTags, "tag", nil, "")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user