switcher

package
v3.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChooseInstallation

func ChooseInstallation(scope binary.Scope, program binary.Program) (binary.Selection, error)

ChooseInstallation selects a concrete installed version. Unified product entries first select an edition, so their version menus stay edition-specific.

func ChooseProgram

func ChooseProgram(supportedPrograms []string) (binary.Program, error)

ChooseProgram shows a menu in terminal to choose program for switch.

func ChooseVersion

func ChooseVersion(scope binary.Scope, program binary.Program) (string, error)

ChooseVersion shows a menu of versions installed in the selected scope.

func Switch

func Switch(switchCtx *SwitchCtx) error

Switch selects an installed version in exactly the requested scope.

Types

type SwitchCtx

type SwitchCtx struct {
	binary.BinaryContext

	// Version of the program to switch to.
	Version string

	// ExactVersion preserves the identity of an installation selected from the menu.
	ExactVersion bool
}

SwitchCtx contains information for switch command.

Jump to

Keyboard shortcuts

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