parse

package
v0.0.0-...-6385711 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package parse contains libraries for parsing dynamic Resources into cobra.Commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAtPath

func AddAtPath(root, subcmd *cobra.Command, path []string)

AddAtPath adds the subcmd to root at the provided path. An empty path will add subcmd as a sub-command of root.

Types

type CommandParser

type CommandParser struct{}

CommandParser parses clidnamic.Commands into cobra.Commands

func (*CommandParser) Parse

func (p *CommandParser) Parse(cmd *clidynamic.Command) (*cobra.Command, Values)

Parse parses the dynamic ResourceCommand into a cobra ResourceCommand

type Flags

type Flags struct {
	// Strings contains a map of flag names to string values
	Strings map[string]*string

	// Ints contains a map of flag names to int values
	Ints map[string]*int32

	// Bools contains a map of flag names to bool values
	Bools map[string]*bool

	// Floats contains a map of flag names to flat values
	Floats map[string]*float64

	// StringSlices contains a map of flag names to string slice values
	StringSlices map[string]*[]string
}

Flags contains flag values setup for the cobra command

type Values

type Values struct {
	// Flags are values provided by the user on the command line
	Flags Flags

	// Responses are values provided by the apiserver in a response
	Responses Flags
}

Values contains input flag values and output response values

func (Values) IsDryRun

func (v Values) IsDryRun() bool

IsDryRun returns true if the command is running in dry-run mode

Jump to

Keyboard shortcuts

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