args

package
v1.2.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2015 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

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

	// Source tree to write results to.
	OutputBase string

	// Package path within the source tree.
	OutputPackagePath string

	// Where to get copyright header text.
	GoHeaderFilePath string
}

GeneratorArgs has arguments common to most 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) 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)

Jump to

Keyboard shortcuts

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