refactor: consolidate packages - move output to cmd, config/session to store, rename Store to GraphStore

This commit is contained in:
2026-04-02 00:18:33 +02:00
parent 2bcc310c6d
commit 03a896d23f
25 changed files with 190 additions and 239 deletions
+5 -5
View File
@@ -3,6 +3,7 @@ package cmd
import (
"axolotl/models"
"axolotl/service"
"axolotl/store"
"fmt"
"os"
"strings"
@@ -11,17 +12,17 @@ import (
)
var jsonFlag bool
var cfg service.Config
var cfg *store.Config
var rootCmd = &cobra.Command{Use: "ax", Short: "The axolotl issue tracker"}
func Execute() {
var err error
cfg, err = service.LoadConfigFile()
cfg, err = store.LoadConfigFile()
if err != nil {
fmt.Fprintln(os.Stderr, "failed to load config:", err)
os.Exit(1)
}
registerAliasCommands()
RegisterAliasCommands()
if err := rootCmd.Execute(); err != nil {
os.Exit(1)
}
@@ -31,7 +32,7 @@ func init() {
rootCmd.PersistentFlags().BoolVar(&jsonFlag, "json", false, "")
}
func registerAliasCommands() {
func RegisterAliasCommands() {
rootCmd.AddGroup(&cobra.Group{ID: "aliases", Title: "Aliases:"})
aliases, _ := cfg.ListAliases()
for _, a := range aliases {
@@ -87,7 +88,6 @@ func registerAliasCommands() {
}
// parseRelInput parses a rel string into a RelInput.
//
// Formats:
// - "prefix::value" → property rel with no target (tag)
// - "relname:target" → edge rel with a target node