cli

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Copyright © 2025 YOUR NAME HERE <EMAIL ADDRESS>

Copyright © 2025 YOUR NAME HERE <EMAIL ADDRESS>

Copyright © 2025 YOUR NAME HERE <EMAIL ADDRESS>

Copyright © 2025 YOUR NAME HERE <EMAIL ADDRESS>

Copyright © 2025 YOUR NAME HERE <EMAIL ADDRESS>

Copyright © 2025 YOUR NAME HERE <EMAIL ADDRESS>

Copyright © 2025 YOUR NAME HERE <EMAIL ADDRESS>

Copyright © 2025 YOUR NAME HERE <EMAIL ADDRESS>

Index

Constants

View Source
const (
	RootUse   = "padz"
	RootShort = "padz create scratch pads, draft files using $EDITOR."
	RootLong  = `` /* 433-byte string literal not displayed */

	// Root command error messages
	ErrFailedToInitStore     = "Failed to initialize store"
	ErrFailedToGetWorkingDir = "Failed to get working directory"
	ErrFailedToGetProject    = "Failed to get current project"
	ErrFailedToCreateNote    = "Failed to create note"

	// Version format
	VersionFormat = "padz version %s (commit: %s, built: %s)\n"

	// Command groups
	GroupSingleScratch = "SINGLE SCRATCH:"
	GroupScratches     = "SCRATCHES:"
)

Root command messages

View Source
const (
	// Global flags
	FlagVerboseDesc = "Increase verbosity (-v, -vv, -vvv)"
	FlagFormatDesc  = "Output format (plain, json, term)"
	FlagVersionDesc = "Print version information"

	// Common flags used across commands
	FlagAllDesc          = "Show scratches from all projects"
	FlagAllDescSearch    = "Search in all projects"
	FlagGlobalDesc       = "Show only global scratches"
	FlagGlobalDescSearch = "Search in global scratches only"
)

Flag messages

View Source
const (
	LsUse   = "ls"
	LsShort = "Lists all scratches for the current project"
	LsLong  = `` /* 136-byte string literal not displayed */

	LsNoScratchesFound = "No scratches found."
)

LS command messages

View Source
const (
	ViewUse   = "view <index>"
	ViewShort = "View a scratch (v)"
	ViewLong  = "View the content of a scratch identified by its index."
)

View command messages

View Source
const (
	OpenUse   = "open <index>"
	OpenShort = "Open a scratch in $EDITOR (o, e)"
	OpenLong  = "Open a scratch, identified by its index, in $EDITOR."

	OpenSuccess = "Scratch updated."
)

Open command messages

View Source
const (
	PeekUse   = "peek <index>"
	PeekShort = "Peek at a scratch"
	PeekLong  = "Peek at the first and last lines of a scratch."

	FlagLinesDesc = "Number of lines to show from the beginning and end"
)

Peek command messages

View Source
const (
	DeleteUse   = "delete <index>"
	DeleteShort = "Delete a scratch (rm, d, del)"
	DeleteLong  = "Delete a scratch identified by its index."

	DeleteSuccess = "Scratch deleted."
)

Delete command messages

View Source
const (
	CleanupUse   = "cleanup"
	CleanupShort = "Cleanup old scratches (clean)"
	CleanupLong  = "Cleanup scratches older than a specified number of days."

	FlagDaysDesc = "Delete scratches older than this many days"

	CleanupSuccessFormat = "Cleaned up scratches older than %d days."
)

Cleanup command messages

View Source
const (
	CopyUse   = "copy <index>"
	CopyShort = "Copy a scratch to the clipboard (cp)"
	CopyLong  = `` /* 197-byte string literal not displayed */

	ErrFailedToCopyScratch   = "Failed to copy scratch to clipboard"
	SuccessCopiedToClipboard = "Copied to clipboard"
)

Copy command messages

View Source
const (
	SearchUse   = "search [term]"
	SearchShort = "Search for a scratch"
	SearchLong  = "Search for a scratch by a regular expression."

	SearchNoMatchesFound = "No matches found."
)

Search command messages

View Source
const (
	NukeUse   = "nuke"
	NukeShort = "Delete all scratches in the current scope"
	NukeLong  = `Delete all scratches in the current scope (project or global).
Use --all to delete all scratches across all scopes.`

	// Confirmation prompts
	NukeConfirmProject = "This will delete all %d pads in [%s]. Confirm? [y/N] "
	NukeConfirmGlobal  = "This will delete all %d pads in global storage. Confirm? [y/N] "
	NukeConfirmAll     = "This will delete all %d pads across all scopes, projects and global. Confirm? [y/N] "

	// Success messages
	NukeSuccessProject = "Deleted all %d pads in [%s]."
	NukeSuccessGlobal  = "Deleted all %d pads in global storage."
	NukeSuccessAll     = "Deleted all %d pads across all scopes."

	// Other messages
	NukeNoPadsFound = "No pads found to delete."
	NukeCancelled   = "Nuke cancelled."
)

Nuke command messages

View Source
const (
	ShowDataFileUse   = "show-data-file"
	ShowDataFileShort = "Show the path to the data directory used by padz"
	ShowDataFileLong  = `` /* 310-byte string literal not displayed */

)

ShowDataFile command messages

Variables

This section is empty.

Functions

func Execute

func Execute() error

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func IsSilentMode added in v1.8.5

func IsSilentMode() bool

IsSilentMode returns true if silent output is enabled

func IsVerboseMode added in v1.8.5

func IsVerboseMode() bool

IsVerboseMode returns true if verbose output is enabled

func NewRootCmd

func NewRootCmd() *cobra.Command

NewRootCmd creates and returns the root command

func ShowListAfterCommand added in v1.8.5

func ShowListAfterCommand(s *store.Store, all, global bool, project string)

ShowListAfterCommand displays the list of scratches after a command if verbose mode is enabled

Types

This section is empty.

Jump to

Keyboard shortcuts

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