commands

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package commands provides the CLI command handlers for SNIP.

Package commands provides the CLI command handlers for SNIP. It implements the command-line interface for managing snippets, categories, and tags.

Package commands provides the CLI command handlers for SNIP.

Package commands provides the CLI command handlers for SNIP.

Package commands provides the CLI command handlers for SNIP.

Package commands provides the CLI command handlers for SNIP.

Package commands provides the CLI command handlers for SNIP.

Package commands provides the CLI command handlers for SNIP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearScreen

func ClearScreen()

ClearScreen clears the terminal screen.

func PrintCommand

func PrintCommand(command string)

PrintCommand displays the command being executed.

func PrintError

func PrintError(msg string)

PrintError displays an error message in red.

func PrintInfo

func PrintInfo(msg string)

PrintInfo displays an informational message in cyan.

func PrintLoading

func PrintLoading(msg string)

PrintLoading displays a loading message with animation.

func PrintLogo()

PrintLogo displays the application logo with branding.

func PrintSuccess

func PrintSuccess(msg string)

PrintSuccess displays a success message in green.

Types

type CLI

type CLI struct {
	// contains filtered or unexported fields
}

CLI coordinates all command handlers and provides the main entry point for command execution.

func NewCLI

func NewCLI(repos *storage.Repositories) *CLI

NewCLI creates a new CLI instance with all command handlers initialized.

func (*CLI) Run

func (cli *CLI) Run(args []string)

Run executes the appropriate command based on the provided arguments. args[0] is expected to be the program name, args[1] is the command.

type CategoryCommand

type CategoryCommand struct {
	// contains filtered or unexported fields
}

CategoryCommand handles category-related operations.

func NewCategoryCommand

func NewCategoryCommand(repos *storage.Repositories) *CategoryCommand

NewCategoryCommand creates a new CategoryCommand instance.

type HelpCommand

type HelpCommand struct {
	// contains filtered or unexported fields
}

HelpCommand handles help-related operations.

func NewHelpCommand

func NewHelpCommand(repos *storage.Repositories) *HelpCommand

NewHelpCommand creates a new HelpCommand instance.

func (*HelpCommand) Print

func (hc *HelpCommand) Print(topic string)

Print displays help information for the specified topic.

type SnippetCommand

type SnippetCommand struct {
	// contains filtered or unexported fields
}

SnippetCommand handles snippet-related operations.

func NewSnippetCommand

func NewSnippetCommand(repos *storage.Repositories) *SnippetCommand

NewSnippetCommand creates a new SnippetCommand instance.

type TagCommand

type TagCommand struct {
	// contains filtered or unexported fields
}

TagCommand handles tag-related operations.

func NewTagCommand

func NewTagCommand(repos *storage.Repositories) *TagCommand

NewTagCommand creates a new TagCommand instance.

Jump to

Keyboard shortcuts

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