alias

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Defaults = map[string]string{
	"mine":     `issue list -a{me} -s~Done`,
	"wip":      `issue list -a{me} -s"In Progress"`,
	"todo":     `issue list -a{me} -s"To Do" --order-by priority`,
	"cur":      `sprint list --current`,
	"mycur":    `sprint list --current -a{me}`,
	"recent":   `issue list --history`,
	"watching": `issue list --watching`,
	"bugs":     `issue list -tBug -s~Done --order-by priority`,
}

Defaults ship with jt and can be overridden (or disabled with an empty value) under `aliases:` in the config.

Functions

func IsBuiltin

func IsBuiltin(root *cobra.Command, name string) bool

IsBuiltin reports whether name resolves to a real command (or its alias), which always wins over a user alias.

func Merge

func Merge(user map[string]string) map[string]string

Merge returns defaults overlaid with user aliases. An empty user value removes the default.

func Names

func Names(aliases map[string]string) []string

Names returns the alias names sorted.

func NewCmdAlias

func NewCmdAlias() *cobra.Command

NewCmdAlias is the alias command.

Types

type Expansion

type Expansion struct {
	// Args replaces os.Args[1:] for a regular alias.
	Args []string
	// Shell is set for "!" aliases: run it with sh -c, Args as "$@".
	Shell string
	// Env carries global flags given before a shell alias (JT_PROJECT,
	// JT_CONFIG_FILE) so nested jt calls in the script honour them.
	Env []string
}

Expansion is the result of resolving an alias.

func Expand

func Expand(root *cobra.Command, args []string, aliases map[string]string, vars Vars) (*Expansion, error)

Expand resolves args (os.Args[1:]) against aliases. It returns nil when args[0] is not an alias.

func Resolve

func Resolve(root *cobra.Command, args []string) (*Expansion, error)

Resolve loads aliases from the config selected by args (-c/--config, JT_CONFIG_FILE or the default) and expands args[0] if it is an alias. A missing or unreadable config only disables user aliases.

type Vars

type Vars struct {
	Me      string
	Project string
	Board   string
}

Vars supplies {me}, {project} and {board} substitutions.

func VarsFromFile

func VarsFromFile(f *jtConfig.File, selector string) Vars

VarsFromFile reads substitution values for the project selected by selector (-p value: a saved name or Jira key), or the current project.

Jump to

Keyboard shortcuts

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