completion

package
v2.14.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

func GetFlagStringValues

func GetFlagStringValues(cmd *cobra.Command, name string) ([]string, error)

GetFlagStringValues get string slice from either a string slice or string flag

func MatchString

func MatchString(pattern, name string) bool

func WithOptions

func WithOptions(cmd *cobra.Command, opts ...Option) *cobra.Command

WithOptions applies given options to the command

Types

type Option

type Option func(*cobra.Command) *cobra.Command

Option adds flags to a given command

func MarkLocalFlag

func MarkLocalFlag(exclude ...string) Option

MarkLocalFlag marks a flag as local flag so it get prioritized in the completions

func WithAgent

func WithAgent(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithAgent agent completion

func WithApplication

func WithApplication(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithApplication application completion

func WithApplicationContext

func WithApplicationContext(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithApplicationContext application context completion

func WithConfiguration

func WithConfiguration(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithConfiguration configuration (managedObject) completion

func WithCustomValidateSet

func WithCustomValidateSet(flagName string, customFunc func() []string) Option

func WithDevice

func WithDevice(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithDevice device completion

func WithDeviceCertificate added in v2.13.0

func WithDeviceCertificate(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithDeviceCertificate trusted device certificate completion

func WithDeviceGroup

func WithDeviceGroup(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithDeviceGroup device group completion

func WithDeviceMeasurementSeries

func WithDeviceMeasurementSeries(flagName string, flagNameDevice string, clientFunc func() (*c8y.Client, error)) Option

WithDeviceMeasurementSeries supported measurement series completion (requires device)

func WithDeviceMeasurementValueFragmentSeries

func WithDeviceMeasurementValueFragmentSeries(flagName string, flagNameDevice string, flagNameValueFragmentType string, clientFunc func() (*c8y.Client, error)) Option

WithDeviceMeasurementValueFragmentSeries supported measurement value fragment types completion (requires device)

func WithDeviceMeasurementValueFragmentType

func WithDeviceMeasurementValueFragmentType(flagName string, flagNameDevice string, clientFunc func() (*c8y.Client, error)) Option

WithDeviceMeasurementValueFragmentType supported measurement value fragment types completion (requires device)

func WithDeviceProfile

func WithDeviceProfile(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithDeviceProfile device profile (managedObject) completion

func WithDeviceRegistrationRequest

func WithDeviceRegistrationRequest(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithDeviceRegistrationRequest device registration request completion

func WithFirmware

func WithFirmware(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithFirmware firmware (managedObject) completion

func WithFirmwarePatch

func WithFirmwarePatch(flagVersion string, flagNameFirmware string, clientFunc func() (*c8y.Client, error)) Option

WithFirmwarePatch firmware patch version completion (requires category)

func WithFirmwareVersion

func WithFirmwareVersion(flagVersion string, flagNameFirmware string, clientFunc func() (*c8y.Client, error)) Option

WithFirmwareVersion firmware version completion (requires category)

func WithHostedApplication

func WithHostedApplication(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithHostedApplication hosted application completion

func WithLazyRequired

func WithLazyRequired(flagName string, values ...string) Option

WithLazyRequired marks a flag as required but does not enforce it.

func WithMicroservice

func WithMicroservice(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithMicroservice microservice completion

func WithMicroserviceInstance

func WithMicroserviceInstance(flagName string, flagApplicationID string, clientFunc func() (*c8y.Client, error)) Option

WithMicroserviceInstance microservice instances completion

func WithSessionFile

func WithSessionFile(flagName string, extensions []string, pathFunc func() string) Option

WithSessionFile session file completion

func WithSmartGroup

func WithSmartGroup(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithSmartGroup smart group completion

func WithSoftware

func WithSoftware(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithSoftware software (managedObject) completion

func WithSoftwareVersion

func WithSoftwareVersion(flagVersion string, flagNameSoftware string, clientFunc func() (*c8y.Client, error)) Option

WithSoftwareVersion software version completion (requires category)

func WithSystemOptionCategory

func WithSystemOptionCategory(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithSystemOptionCategory system option category completion

func WithSystemOptionKey

func WithSystemOptionKey(flagName string, flagNameCategory string, clientFunc func() (*c8y.Client, error)) Option

WithSystemOptionKey system option key completion (requires category)

func WithTenantID

func WithTenantID(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithTenantID tenant id completion

func WithTenantOptionCategory

func WithTenantOptionCategory(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithTenantOptionCategory tenant option category completion

func WithTenantOptionKey

func WithTenantOptionKey(flagName string, flagNameCategory string, clientFunc func() (*c8y.Client, error)) Option

WithTenantOptionKey tenant option key completion (requires category)

func WithUser

func WithUser(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithUser user completion

func WithUserGroup

func WithUserGroup(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithUserGroup usergroup completion

func WithUserRole

func WithUserRole(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithUserRole user role completion

func WithValidateSet

func WithValidateSet(flagName string, values ...string) Option

WithValidateSet adds a completion function with the given values

Jump to

Keyboard shortcuts

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