options

package
v0.4.28 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNilOptions = errors.New("attempted to configure a nil option set")
)

Functions

This section is empty.

Types

type ConfigCommandAPI

type ConfigCommandAPI struct {
	*Options
}

ConfigCommandAPI provides an indirect API for user command interactions with a Table - without causing cyclic imports :-(

See command.ConfigAPI

func (*ConfigCommandAPI) SetLocaleTag

func (cfg *ConfigCommandAPI) SetLocaleTag(localeTag string)

func (*ConfigCommandAPI) SetPrefix

func (cfg *ConfigCommandAPI) SetPrefix(prefix string)

func (*ConfigCommandAPI) SetPrefixPattern

func (cfg *ConfigCommandAPI) SetPrefixPattern(pattern string)

func (*ConfigCommandAPI) SetProfile

func (cfg *ConfigCommandAPI) SetProfile(profile *profile.Profile)

type Option

type Option func(*Options) error

func WithCommandArgs

func WithCommandArgs(args []string) Option

any number of inline commands, e.g. sort insert wip delete bad ...

func WithLocaleTag

func WithLocaleTag(localeTag string) Option

see also "locale" command

func WithPrefix

func WithPrefix(prefix string) Option

see also "prefix" command

func WithPrefixPattern

func WithPrefixPattern(pattern string) Option

see also "prefix" command

func WithProfile

func WithProfile(profile *profile.Profile) Option

see also "profile" command

func WithProfileName

func WithProfileName(name string) Option

see also "profile" command

type Options

type Options struct {
	// contains filtered or unexported fields
}

Options provides configuration parameters for tables and documents

By default, the options for a document or table are nil.

  • All options MUST be set via the appropriate With{Option} function.
  • All options are provided as pointer methods which return default values for nil pointers!

func New

func New(opts ...Option) *Options

New creates a new set of options.

func (*Options) CommandArgs

func (o *Options) CommandArgs() []string

func (*Options) Commands

func (o *Options) Commands() []api.Command

func (*Options) Configure

func (o *Options) Configure(opts ...Option)

func (*Options) Errors

func (o *Options) Errors() error

func (*Options) LocaleTag

func (o *Options) LocaleTag() string

func (*Options) Prefix

func (o *Options) Prefix(matchedPrefix string) string

func (*Options) PrefixMatcher

func (o *Options) PrefixMatcher() *prefix.Matcher

func (*Options) Profile

func (o *Options) Profile() *profile.Profile

func (*Options) String

func (o *Options) String() string

Jump to

Keyboard shortcuts

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