refactor: replace explicit fields with tag-based property system

This commit is contained in:
2026-03-27 02:11:46 +01:00
parent 2d4cff717b
commit b2225cff7b
17 changed files with 485 additions and 825 deletions

View File

@@ -10,21 +10,18 @@ import (
)
var showCmd = &cobra.Command{
Use: "show <id>",
Short: "Show node details",
Args: cobra.ExactArgs(1),
Use: "show <id>", Short: "Show node details", Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
d, err := db.GetDB()
if err != nil {
fmt.Fprintln(os.Stderr, err)
return
}
n, err := d.NodeByID(args[0])
if err != nil {
if n, err := d.NodeByID(args[0]); err == nil {
output.PrintNode(cmd.OutOrStdout(), n, jsonFlag)
} else {
fmt.Fprintln(os.Stderr, "node not found:", args[0])
return
}
output.PrintNode(cmd.OutOrStdout(), n, jsonFlag)
},
}