flags

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrHelp = flag.ErrHelp

ErrHelp should be visible without drilling into the original flag package.

Functions

func ModeStrings added in v1.1.0

func ModeStrings() []string

ModeStrings returns a slice of all String values of the enum

func ProtocolStrings added in v1.1.0

func ProtocolStrings() []string

ProtocolStrings returns a slice of all String values of the enum

Types

type Mode added in v1.1.0

type Mode uint

Mode is the operation modeFlag.

const (
	// Client mode pretends to be an LSP to a VSCode client.
	// In this mode flags must provide connection data to VSCode.
	// The required flag must specify the client connection (e.g. -clientPort).
	Client Mode = iota

	// Nexus mode uses LSP as server and pretends to be LSP to VSCode client.
	// In this mode communication between the two is passed through and logged.
	Nexus

	// Server mode tests the LSP as a server, pretending to be a VSCode client.
	// In this mode flags must provide connection data to the LSP.
	// The required flag must specify the server connection (e.g. -serverPort).
	Server
)

func ModeString added in v1.1.0

func ModeString(s string) (Mode, error)

ModeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func ModeValues added in v1.1.0

func ModeValues() []Mode

ModeValues returns all values of the enum

func (Mode) IsAMode added in v1.1.0

func (i Mode) IsAMode() bool

IsAMode returns "true" if the value is listed in the enum definition. "false" otherwise

func (Mode) MarshalText added in v1.1.0

func (i Mode) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for Mode

func (Mode) String added in v1.1.0

func (i Mode) String() string

func (*Mode) UnmarshalText added in v1.1.0

func (i *Mode) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for Mode

type Protocol added in v1.1.0

type Protocol uint

Protocol is the LSP communications protocolFlag.

const (
	// Sub protocol runs LSP as sub-process and communicate via it's stdin/stdout.
	Sub Protocol = iota

	// TCP protocol communicates with LSP via TCP ports.
	TCP
)

func ProtocolString added in v1.1.0

func ProtocolString(s string) (Protocol, error)

ProtocolString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func ProtocolValues added in v1.1.0

func ProtocolValues() []Protocol

ProtocolValues returns all values of the enum

func (Protocol) IsAProtocol added in v1.1.0

func (i Protocol) IsAProtocol() bool

IsAProtocol returns "true" if the value is listed in the enum definition. "false" otherwise

func (Protocol) MarshalText added in v1.1.0

func (i Protocol) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for Protocol

func (Protocol) String added in v1.1.0

func (i Protocol) String() string

func (*Protocol) UnmarshalText added in v1.1.0

func (i *Protocol) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for Protocol

type Set

type Set struct {
	*flag.FlagSet
	// contains filtered or unexported fields
}

func NewSet

func NewSet() *Set

func (*Set) ClientPort

func (s *Set) ClientPort() uint

func (*Set) Command added in v1.1.0

func (s *Set) Command() (string, []string)

func (*Set) CommandArgs added in v1.1.0

func (s *Set) CommandArgs() string

func (*Set) HasCommand added in v1.1.0

func (s *Set) HasCommand() bool

func (*Set) HostAddress

func (s *Set) HostAddress() string

func (*Set) LogFileAppend

func (s *Set) LogFileAppend() bool

func (*Set) LogFileFormat

func (s *Set) LogFileFormat() string

func (*Set) LogFileLevel added in v1.1.0

func (s *Set) LogFileLevel() zerolog.Level

func (*Set) LogFilePath

func (s *Set) LogFilePath() string

func (*Set) LogLevel

func (s *Set) LogLevel() zerolog.Level

func (*Set) LogMessageTwice added in v0.6.0

func (s *Set) LogMessageTwice() bool

func (*Set) LogStdFormat

func (s *Set) LogStdFormat() string

func (*Set) MaxFieldDisplayLength

func (s *Set) MaxFieldDisplayLength() int

func (*Set) MessageDir

func (s *Set) MessageDir() string

func (*Set) Mode added in v1.1.0

func (s *Set) Mode() Mode

func (*Set) ModeConnectsToClient added in v1.1.0

func (s *Set) ModeConnectsToClient() bool

func (*Set) ModeConnectsToServer added in v1.1.0

func (s *Set) ModeConnectsToServer() bool

func (*Set) Protocol added in v1.1.0

func (s *Set) Protocol() Protocol

func (*Set) RequestPath

func (s *Set) RequestPath() string

func (*Set) ServerPort

func (s *Set) ServerPort() int

func (*Set) Validate added in v1.1.0

func (s *Set) Validate() error

func (*Set) ValidateLogging added in v1.1.0

func (s *Set) ValidateLogging() error

func (*Set) Version added in v1.0.2

func (s *Set) Version() bool

func (*Set) WebPort

func (s *Set) WebPort() uint

Jump to

Keyboard shortcuts

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