get.go

 1// SPDX-FileCopyrightText: Amolith <amolith@secluded.site>
 2//
 3// SPDX-License-Identifier: AGPL-3.0-or-later
 4
 5package note
 6
 7import (
 8	"fmt"
 9
10	"git.secluded.site/lune/internal/validate"
11	"github.com/spf13/cobra"
12)
13
14// GetCmd retrieves a note by ID. Exported for potential use by shortcuts.
15var GetCmd = &cobra.Command{
16	Use:   "get ID",
17	Short: "Get a note by ID or reference",
18	Args:  cobra.ExactArgs(1),
19	RunE: func(cmd *cobra.Command, args []string) error {
20		id, err := validate.Reference(args[0])
21		if err != nil {
22			return err
23		}
24
25		// TODO: implement note get
26		fmt.Fprintf(cmd.OutOrStdout(), "Getting note %s (not yet implemented)\n", id)
27
28		return nil
29	},
30}
31
32func init() {
33	GetCmd.Flags().Bool("json", false, "Output as JSON")
34}