subcommands

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: ISC Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func List() [][]string

func Register

func Register(factory CmdFactory, flags CommandFlags, args ...string)

Types

type CmdFactory

type CmdFactory func() Subcommand

type CommandFlags

type CommandFlags uint32
const (
	NeedRepositoryKey CommandFlags = 1 << iota
	BeforeRepositoryWithStorage
	BeforeRepositoryOpen
)

type Subcommand

type Subcommand interface {
	Parse(ctx *appcontext.AppContext, args []string) error
	Execute(ctx *appcontext.AppContext, repo *repository.Repository) (int, error)
	GetRepositorySecret() []byte
	GetFlags() CommandFlags
	// contains filtered or unexported methods
}

func Lookup

func Lookup(arguments []string) (Subcommand, []string, []string)

type SubcommandBase

type SubcommandBase struct {
	RepositorySecret []byte
	Flags            CommandFlags
}

func (*SubcommandBase) GetFlags

func (cmd *SubcommandBase) GetFlags() CommandFlags

func (*SubcommandBase) GetRepositorySecret

func (cmd *SubcommandBase) GetRepositorySecret() []byte

Jump to

Keyboard shortcuts

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