Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var InsprOptions struct { SampleFlagValue string // Scope receives the dApp scope/context from the cli Scope string // AppliedFileStructure receives the folder/file to be applied AppliedFileStructure string // AppliedFolderStructure receives the folder/file to be applied AppliedFolderStructure string // DryRun defines if given command will be a dry run or not DryRun bool // Update defines if Apply is going to create a new app or update an existing one Update bool Token string Config string // Host receives the request Host/Header field from the cli Host string }
InsprOptions values for the cli
Functions ¶
func AddFlags ¶
AddFlags adds to the command the common flags that are annotated with the command name.
func ParseFlags ¶
ParseFlags - adds flags to the cmd given
Types ¶
type Builder ¶
type Builder interface { WithAliases(...string) Builder WithDescription(description string) Builder WithLongDescription(long string) Builder WithExample(comment, command string) Builder WithFlagAdder(adder func(*pflag.FlagSet)) Builder WithFlags(...*Flag) Builder WithCommonFlags() Builder Hidden() Builder ExactArgs(argCount int, action func(context.Context, []string) error) *cobra.Command MinimumArgs(argCount int, action func(context.Context, []string) error) *cobra.Command NoArgs(action func(context.Context) error) *cobra.Command AddSubCommand(cmds ...*cobra.Command) Builder Version(version string) Builder WithOptions(...Option) Builder ValidArgsFunc(validation func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)) Builder WithRequiredFlag(string) Builder Super() *cobra.Command }
Builder is used to build cobra commands. it contains all the methods to manipulate a command
type Flag ¶
type Flag struct { Name string Shorthand string Usage string // Pointer to where the value of the flag will be stored Value interface{} // Default value of the flag. Needs to be set and determines the type of the flag that will be created DefValue interface{} DefValuePerCommand map[string]interface{} FlagAddMethod string DefinedOn []string Hidden bool // contains filtered or unexported fields }
Flag defines a INSPR CLI flag which contains a list of subcommands the flag belongs to in `DefinedOn` field.
Click to show internal directories.
Click to hide internal directories.