mmdiary

package
v0.0.0-...-d37b328 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Copyright © 2024 NAME HERE <EMAIL ADDRESS>

Copyright © 2024 NAME HERE <EMAIL ADDRESS>

Index

Constants

This section is empty.

Variables

View Source
var CommitCmd = &cobra.Command{
	Use:          "commit <group>",
	Short:        "Commit udpated diary records to history",
	Long:         ``,
	SilenceUsage: true,
	RunE: func(cmd *cobra.Command, args []string) error {
		if len(args) != 1 {
			return mmerr.NewArgsError(
				mmerr.DiaryCmdType,
				fmt.Sprintf("accepts 1 args, received %d", len(args)),
			)
		}
		group := args[0]

		model, err := tui.InitCommitDiaryModel(group)
		if err != nil {
			return fmt.Errorf("diary commit sub-command failed: %w", err)
		}

		if _, err := tea.NewProgram(model, tea.WithAltScreen()).Run(); err != nil {
			return fmt.Errorf("diary commit sub-command failed: %w", err)
		}

		return nil
	},
}

commitCmd represents the commit command

View Source
var DiaryCmd = &cobra.Command{
	Use:          "diary <group> <plugin>",
	Short:        "Show notes of resources in a group",
	Long:         ``,
	SilenceUsage: true,
	RunE: func(cmd *cobra.Command, args []string) error {
		if len(args) != 2 {
			return mmerr.NewArgsError(
				mmerr.DiaryCmdType,
				fmt.Sprintf("accepts 2 args, received %d", len(args)),
			)
		}
		group := args[0]
		plugin := args[1]

		model, err := tui.InitDiaryModel(group, plugin)
		if err != nil {
			return fmt.Errorf("diary sub-command failed: %w", err)
		}

		if _, err := tea.NewProgram(model, tea.WithAltScreen()).Run(); err != nil {
			return fmt.Errorf("diary sub-command failed: %w", err)
		}

		return nil
	},
}

diaryCmd represents the diary command

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL