cmn

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2024 License: Unlicense Imports: 5 Imported by: 0

Documentation

Overview

Package cmn implements common variables and utility functions for git-wt, providing debug 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.
	Config   *Cfg   = &Cfg{} // Global configuration for the program.
)

Functions

func Debug

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

Debug writes debug output to Stderr if DebugFlag is true.

func InitConfig

func InitConfig() error

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 Cfg added in v0.2.0

type Cfg struct {
	DebugFlag     bool   // Whether debug output is enabled.
	DefaultBranch string // Default branch/worktree of the project.
	InitialDir    string // Initial working directory of the program.
	ProjectDir    string // Path of the project directory.

} // Configuration for the program.

type CfgMk

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

} // 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.

type CfgXx added in v0.2.0

type CfgXx struct {
	Branches  bool // Whether to reset branches.
	Worktrees bool // Whether to reset worktrees.
	Most      bool // Whether to reset both branches and worktrees.
	All       bool // Whether to wipe everyting and clone again.

} // Configuration for 'xx' command.

Jump to

Keyboard shortcuts

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