config

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package config handles configuration and command line argument parsing for ghprmerge.

Index

Constants

This section is empty.

Variables

View Source
var ErrHelp = flag.ErrHelp

ErrHelp is returned when -help or -h is passed.

View Source
var ErrVersion = errors.New("version requested")

ErrVersion is returned when --version is passed.

Functions

This section is empty.

Types

type Command added in v0.4.0

type Command string

Command represents the subcommand to execute.

const (
	CommandNone   Command = ""
	CommandMerge  Command = "merge"
	CommandRebase Command = "rebase"
	CommandReport Command = "report"
)

type CommandDescription added in v0.4.1

type CommandDescription struct {
	Name        Command
	Description string
}

type Config

type Config struct {
	Org                string
	SourceBranches     []string
	SourceBranch       string // First source branch (for backward compat in merger)
	Rebase             bool
	Merge              bool
	SkipRebase         bool
	Repos              []string
	RepoLimit          int
	JSON               bool
	Confirm            bool
	Verbose            bool
	NoColor            bool
	NoProgress         bool
	Token              string
	Report             bool
	SourceBranchPrefix []string
	MinGroupSize       int
	Verbosity          string
	Command            Command
}

Config holds all configuration for ghprmerge.

func ParseFlags

func ParseFlags(args []string, version string) (*Config, error)

ParseFlags parses command-line flags and environment variables. Supports subcommands: merge, rebase, report Usage: ghprmerge [global-flags] <command> [command-flags]

func (*Config) IsAnalysisOnly

func (c *Config) IsAnalysisOnly() bool

IsAnalysisOnly returns true if neither rebase nor merge subcommand is used.

func (*Config) Validate

func (c *Config) Validate() error

Validate checks that all required configuration is present.

type StringSliceFlag

type StringSliceFlag []string

StringSliceFlag is a custom flag type that collects multiple string values.

func (*StringSliceFlag) Set

func (s *StringSliceFlag) Set(value string) error

func (*StringSliceFlag) String

func (s *StringSliceFlag) String() string

Jump to

Keyboard shortcuts

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