kubernetesk8s.io/kubernetes/cmd/libs/go2idl/args Index | Files

package args

import "k8s.io/kubernetes/cmd/libs/go2idl/args"

Package args has common command-line flags for generation programs.

Index

Functions

func DefaultSourceTree

func DefaultSourceTree() string

DefaultSourceTree returns the /src directory of the first entry in $GOPATH. If $GOPATH is empty, it returns "./". Useful as a default output location.

Types

type GeneratorArgs

type GeneratorArgs struct {
	// Which directories to parse.
	InputDirs []string

	// If true, recurse into all children of InputDirs
	Recursive bool

	// Source tree to write results to.
	OutputBase string

	// Package path within the source tree.
	OutputPackagePath string

	// Where to get copyright header text.
	GoHeaderFilePath string

	// If true, only verify, don't write anything.
	VerifyOnly bool

	// Any custom arguments go here
	CustomArgs interface{}
}

GeneratorArgs has arguments that are passed to generators.

func Default

func Default() *GeneratorArgs

Default returns a defaulted GeneratorArgs. You may change the defaults before calling AddFlags.

func (*GeneratorArgs) AddFlags

func (g *GeneratorArgs) AddFlags(fs *pflag.FlagSet)

func (*GeneratorArgs) Execute

func (g *GeneratorArgs) Execute(nameSystems namer.NameSystems, defaultSystem string, pkgs func(*generator.Context, *GeneratorArgs) generator.Packages) error

Execute implements main(). If you don't need any non-default behavior, use as: args.Default().Execute(...)

func (*GeneratorArgs) InputIncludes

func (g *GeneratorArgs) InputIncludes(p *types.Package) bool

InputIncludes returns true if the given package is a (sub) package of one of the InputDirs.

func (*GeneratorArgs) LoadGoBoilerplate

func (g *GeneratorArgs) LoadGoBoilerplate() ([]byte, error)

LoadGoBoilerplate loads the boilerplate file passed to --go-header-file.

func (*GeneratorArgs) NewBuilder

func (g *GeneratorArgs) NewBuilder() (*parser.Builder, error)

NewBuilder makes a new parser.Builder and populates it with the input directories.

Source Files

args.go

Version
v1.3.0-alpha.4
Published
May 17, 2016
Platform
js/wasm
Imports
13 packages
Last checked
42 seconds ago

Tools for package owners.