list.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/completion"
11	"github.com/spf13/cobra"
12)
13
14// ListCmd lists notes. Exported for potential use by shortcuts.
15var ListCmd = &cobra.Command{
16	Use:   "list",
17	Short: "List notes",
18	Long: `List notes from Lunatask.
19
20Note: Due to end-to-end encryption, note names and content
21are not available through the API. Only metadata is shown.`,
22	RunE: func(cmd *cobra.Command, _ []string) error {
23		// TODO: implement note listing
24		fmt.Fprintln(cmd.OutOrStdout(), "Note listing not yet implemented")
25
26		return nil
27	},
28}
29
30func init() {
31	ListCmd.Flags().StringP("notebook", "b", "", "Filter by notebook key")
32	ListCmd.Flags().Bool("json", false, "Output as JSON")
33
34	_ = ListCmd.RegisterFlagCompletionFunc("notebook", completion.Notebooks)
35}