flags

package
v0.0.0-...-6c6fd4c Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package flags contains cobra CLI stuff

Index

Constants

This section is empty.

Variables

View Source
var Generate = func() *cobra.Command {
	enumName := must(newRegexp("^.+Enum$"))

	cmd := &cobra.Command{
		Use:                   "generate package [package...]",
		DisableFlagsInUseLine: true,
		Short:                 "read sources and generate the code",
		Run:                   func(cmd *cobra.Command, args []string) { generateRun(cmd, args, enumName) },
		Args:                  cobra.MinimumNArgs(1),
	}

	cmd.Flags().StringArray(buildTagsFlag, nil, "build tags to be used for sources parsing")
	cmd.Flags().StringArray(envVarsFlag, nil, "environment variables to be used for sources parsing")
	cmd.Flags().Bool(excludeTestsFlag, false, "do not process test files")
	cmd.Flags().Var(enumName, enumNameFlag, "regexp to find the Name type(s)")

	return cmd
}()

Generate is a generate CLI command.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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