tag add/remove/list for machine-local tags. identity prints full label set. --only/--never flags on add. target command to set/clear targeting on existing entries. SetTargeting garden method. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
28 lines
453 B
Go
28 lines
453 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/kisom/sgard/garden"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var identityCmd = &cobra.Command{
|
|
Use: "identity",
|
|
Short: "Show this machine's identity labels",
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
g, err := garden.Open(repoFlag)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
for _, label := range g.Identity() {
|
|
fmt.Println(label)
|
|
}
|
|
return nil
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(identityCmd)
|
|
}
|