Fix assignee filter bug in List

This commit is contained in:
2026-03-29 18:58:34 +02:00
parent 9e8c37564f
commit 13b4c4b651
22 changed files with 939 additions and 555 deletions

View File

@@ -1,6 +1,8 @@
package cmd
import (
"axolotl/service"
"fmt"
"os"
"strings"
@@ -8,15 +10,43 @@ import (
)
var jsonFlag bool
var cfg service.Config
var rootCmd = &cobra.Command{Use: "ax", Short: "The axolotl issue tracker"}
func Execute() {
var err error
cfg, err = service.LoadConfig()
if err != nil {
fmt.Fprintln(os.Stderr, "failed to load config:", err)
os.Exit(1)
}
registerAliasCommands()
rootCmd.SetArgs(transformArgs(os.Args[1:]))
if err := rootCmd.Execute(); err != nil {
os.Exit(1)
}
}
func registerAliasCommands() {
rootCmd.AddGroup(&cobra.Group{ID: "aliases", Title: "Aliases:"})
aliases, _ := cfg.ListAliases()
for _, a := range aliases {
a := a
rootCmd.AddCommand(&cobra.Command{
Use: a.Name,
Short: a.Description,
GroupID: "aliases",
Run: func(cmd *cobra.Command, args []string) {
expanded := service.ExpandAlias(a, args, cfg.GetUser())
rootCmd.SetArgs(transformArgs(expanded))
if err := rootCmd.Execute(); err != nil {
os.Exit(1)
}
},
})
}
}
func transformArgs(args []string) []string {
aliases := map[string]string{
"--status": "_status",