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

package person

import (
	"fmt"

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

// AddCmd creates a new person. Exported for potential use by shortcuts.
var AddCmd = &cobra.Command{
	Use:   "add FIRST LAST",
	Short: "Add a new person",
	Args:  cobra.ExactArgs(2),
	RunE: func(cmd *cobra.Command, args []string) error {
		// TODO: implement person creation
		fmt.Fprintf(cmd.OutOrStdout(), "Adding person: %s %s (not yet implemented)\n", args[0], args[1])

		return nil
	},
}

func init() {
	AddCmd.Flags().StringP("relationship", "r", "", "Relationship strength")

	_ = AddCmd.RegisterFlagCompletionFunc("relationship", completion.Relationships)
}
