cmn

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: Unlicense Imports: 4 Imported by: 0

Documentation

Overview

Package cmn implements common variables and utility functions for git-wt, providing debug, exit, and configuration.

Index

Constants

This section is empty.

Variables

View Source
var (
	Basename string // Base name of the program; injected during compile.
	Version  string // Version of the program; injected during compile.

	DebugFlag bool // Whether debug output is enabled.

	InitialDir    string // Initial working directory of the program.
	ProjectDir    string // Path of the project directory.
	DefaultBranch string // Default branch/worktree of the project.
)

Functions

func Debug

func Debug(format string, args ...interface{})

Debug writes debug output to Stderr if DebugFlag is true.

func Exit

func Exit(retval int, format string, args ...interface{})

Exit writes the provided error details to Stderr then exits with the provided value.

func InitConfig

func InitConfig()

InitConfig locates and reads the configuration file for use.

func WriteConfig

func WriteConfig(path string, branch string) error

WriteConfig writes program's config file to cloned repo's project path.

Types

type CfgMk

type CfgMk struct {
	Branch      string
	BranchReset string
	CheckoutNo  bool
	Force       bool
	Track       bool
	Quiet       bool

} // Configuration for 'mk' command.

type CfgMv

type CfgMv struct {
	Force bool

} // Configuration for 'mv' command.

type CfgRm

type CfgRm struct {
	Force bool

} // Configuration for 'rm' command.

Jump to

Keyboard shortcuts

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