// SPDX-FileCopyrightText: Amolith <amolith@secluded.site>
//
// SPDX-License-Identifier: AGPL-3.0-or-later

package person

import (
	"fmt"

	"git.secluded.site/lune/internal/validate"
	"github.com/spf13/cobra"
)

// GetCmd retrieves a person by ID. Exported for potential use by shortcuts.
var GetCmd = &cobra.Command{
	Use:   "get ID",
	Short: "Get a person by ID or reference",
	Args:  cobra.ExactArgs(1),
	RunE: func(cmd *cobra.Command, args []string) error {
		id, err := validate.Reference(args[0])
		if err != nil {
			return err
		}

		// TODO: implement person get
		fmt.Fprintf(cmd.OutOrStdout(), "Getting person %s (not yet implemented)\n", id)

		return nil
	},
}

func init() {
	GetCmd.Flags().Bool("json", false, "Output as JSON")
}
