scope

package
v0.17.15 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package scope implements the stackit scope command for managing branch scopes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Action

func Action(ctx *app.Context, opts Options, handler Handler) error

Action implements the stackit scope command

Types

type Handler

type Handler interface {
	// PromptConfirmRename prompts user to confirm branch rename after scope change
	// Returns true to proceed with rename, false to skip
	PromptConfirmRename(branchName, oldScope, newScope string) (bool, error)

	// Cleanup restores terminal state (may be no-op)
	Cleanup()

	// IsInteractive returns true if the handler supports interactive prompts
	IsInteractive() bool
}

Handler receives events from scope action

type NullHandler

type NullHandler struct {
	handler.NullBase
}

NullHandler is a no-op handler for when nil is passed. It embeds handler.NullBase for Cleanup() and IsInteractive().

func (*NullHandler) PromptConfirmRename

func (h *NullHandler) PromptConfirmRename(string, string, string) (bool, error)

PromptConfirmRename implements Handler. Returns false (skip rename) for null handler.

type Options

type Options struct {
	Scope string
	Unset bool
	Show  bool
}

Options contains options for the scope command

Jump to

Keyboard shortcuts

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