Help us shape the future of Go! Take the 2026 Go Developer Survey

startup

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package startup parses jira's global flags and first subcommand out of the raw argv before cobra runs. The root alias-expansion preflight needs the requested config/profile and the first command token before the command tree is built, so this logic operates on []string directly — no cobra.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SplitFirstCommandArg

func SplitFirstCommandArg(args []string) (prefix []string, command string, rest []string, ok bool)

SplitFirstCommandArg returns the argv prefix preceding the first non-flag token, that token (the command name), and the remaining args. ok is false when no command token is present.

Types

type Globals

type Globals struct {
	ConfigPath string
	Profile    string
}

Globals holds the root persistent-flag values recovered from raw argv during the pre-cobra preflight: the requested config path and profile.

func GlobalsFromArgs

func GlobalsFromArgs(args []string) Globals

GlobalsFromArgs scans argv for the --config/--profile (and -c/-P) global flags and returns their values, ignoring everything else.

Jump to

Keyboard shortcuts

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