arguments

package
v0.0.0-...-20d847b Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BazelRCPath

type BazelRCPath struct {
	Path     path.Parser
	Required bool
}

BazelRCPath holds a path at which a bazelrc configuration file is stored, and whether the file is required to exist. All bazelrc files are bazelrc files are optional, except for the ones provided to the --bazelrc startup flag.

func GetBazelRCPaths

func GetBazelRCPaths(startupFlags *StartupFlags, startupFlagsPathFormat path.Format, workspacePath, homeDirectoryPath, workingDirectoryPath path.Parser) ([]BazelRCPath, error)

GetBazelRCPaths returns the paths of the bazelrc configuration files that should be evaluated, based on the startup flags, the workspace path and the user's home directory. This logic is consistent with https://bazel.build/run/bazelrc#bazelrc-file-locations.

type BazelRCReader

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

BazelRCReader is a reader for ".bazelrc" files. These files may list flags that need to be provided to Bazel, either by default or by providing --config= flags.

func NewBazelRCReader

func NewBazelRCReader(r io.RuneReader) *BazelRCReader

NewBazelRCReader wraps an io.RuneReader, providing it a BazelRCReader that can be used to read lines from ".bazelrc" files.

func (*BazelRCReader) Read

func (r *BazelRCReader) Read() ([]string, error)

Read the contents of the ".bazelrc" file, up to and including the next line that contains one or more fields of text.

type Command

type Command interface {
	Reset()
}

func Parse

func Parse(args []string, rootDirectory filesystem.Directory, pathFormat path.Format, workspacePath, homeDirectoryPath, workingDirectoryPath path.Parser) (Command, error)

func ParseCommandAndArguments

func ParseCommandAndArguments(configurationDirectives ConfigurationDirectives, args []string) (Command, error)

type CommandDoesNotTakeArgumentsError

type CommandDoesNotTakeArgumentsError struct {
	Command string
}

func (CommandDoesNotTakeArgumentsError) Error

type CommandNotRecognizedError

type CommandNotRecognizedError struct {
	Command string
}

func (CommandNotRecognizedError) Error

type ConfigExpansionContainsCycleError

type ConfigExpansionContainsCycleError struct {
	Directive string
}

func (ConfigExpansionContainsCycleError) Error

type ConfigValueNotRecognizedError

type ConfigValueNotRecognizedError struct {
	Config string
}

func (ConfigValueNotRecognizedError) Error

type ConfigurationDirectives

type ConfigurationDirectives map[string][][]string

func ParseBazelRCFiles

func ParseBazelRCFiles(bazelRCPaths []BazelRCPath, rootDirectory filesystem.Directory, pathFormat path.Format, workspacePath, workingDirectoryPath path.Parser) (ConfigurationDirectives, error)

type FlagInvalidEnumValueError

type FlagInvalidEnumValueError struct {
	Flag           string
	Value          string
	ExpectedValues []string
}

func (FlagInvalidEnumValueError) Error

type FlagMissingValueError

type FlagMissingValueError struct {
	Flag string
}

func (FlagMissingValueError) Error

func (e FlagMissingValueError) Error() string

type FlagNotApplicableError

type FlagNotApplicableError struct {
	Flag string
}

func (FlagNotApplicableError) Error

func (e FlagNotApplicableError) Error() string

type FlagNotRecognizedError

type FlagNotRecognizedError struct {
	Flag string
}

func (FlagNotRecognizedError) Error

func (e FlagNotRecognizedError) Error() string

type FlagUnexpectedValueError

type FlagUnexpectedValueError struct {
	Flag string
}

func (FlagUnexpectedValueError) Error

func (e FlagUnexpectedValueError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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