cmd

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

func RunMigrations

func RunMigrations(dbPath string) error

RunMigrations applies database migrations to the specified database

func ShortenPath

func ShortenPath(path string, maxLength int) string

ShortenPath converts

/Users/foo/Documents/bar/baz  -> ~/D/b/baz
/usr/share/screen/utf8encodings -> /u/s/s/utf8encodings

Types

type CommandAdder

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

CommandAdder handles adding commands to history

func NewCommandAdder

func NewCommandAdder(config string, verbose bool) *CommandAdder

NewCommandAdder creates a new CommandAdder instance

func (*CommandAdder) AddCommand

func (ca *CommandAdder) AddCommand(command string, directory string, tty string, sid string, hostname string, username string, noDedup bool) (bool, error)

AddCommand adds a command to history Returns (isDuplicate, error)

type InitConfig

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

InitConfig handles configuration initialization

func NewInitConfig

func NewInitConfig(configPath string) (*InitConfig, error)

NewInitConfig creates a new InitConfig instance

func (*InitConfig) CreateDefaultConfig

func (ic *InitConfig) CreateDefaultConfig() error

CreateDefaultConfig creates a default config file if it doesn't exist

func (*InitConfig) CreateZshIntegration

func (ic *InitConfig) CreateZshIntegration() error

CreateZshIntegration creates the Zsh integration script

func (*InitConfig) EnsureConfigDir

func (ic *InitConfig) EnsureConfigDir() error

EnsureConfigDir creates the config directory if it doesn't exist

func (*InitConfig) GetConfigPath

func (ic *InitConfig) GetConfigPath() string

GetConfigPath returns the full path to the config file

func (*InitConfig) InitializeDatabase

func (ic *InitConfig) InitializeDatabase() error

InitializeDatabase loads config and initializes the database

Jump to

Keyboard shortcuts

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