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:
@@ -76,3 +76,10 @@ func transformArgs(args []string) []string {
|
||||
func init() {
|
||||
rootCmd.PersistentFlags().BoolVar(&jsonFlag, "json", false, "")
|
||||
}
|
||||
|
||||
func addPropertyFlags(cmd *cobra.Command) {
|
||||
cmd.Flags().String("type", "", "node type")
|
||||
cmd.Flags().String("status", "", "node status")
|
||||
cmd.Flags().String("prio", "", "node priority")
|
||||
cmd.Flags().String("namespace", "", "node namespace")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user