cmd

package
v3.35.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: Apache-2.0, Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Copyright 2022 Molecula Corp. (DBA FeatureBase). SPDX-License-Identifier: Apache-2.0

Copyright 2022 Molecula Corp. (DBA FeatureBase). SPDX-License-Identifier: Apache-2.0

Copyright 2022 Molecula Corp. All rights reserved.

Copyright 2022 Molecula Corp. (DBA FeatureBase). SPDX-License-Identifier: Apache-2.0

Copyright 2022 Molecula Corp. (DBA FeatureBase). SPDX-License-Identifier: Apache-2.0

Copyright 2021 Molecula Corp. All rights reserved.

Copyright 2021 Molecula Corp. All rights reserved.

Copyright 2022 Molecula Corp. (DBA FeatureBase). SPDX-License-Identifier: Apache-2.0

Package cmd contains all the pilosa subcommand definitions (1 per file).

Each command file has an init function and a New*Cmd function, as well as a global exported instance of the command.

The New*Cmd function is a function which returns a cobra.Command object wrapping this subcommand.

The init function adds the New*Cmd to a map of subcommand functions which ensures that no two commands have the same name, and is used when a new root command is created to instantiate all of the subcommands.

The instance of the command is global and exported so that it can be tested.

Copyright 2022 Molecula Corp. (DBA FeatureBase). SPDX-License-Identifier: Apache-2.0

Copyright 2022 Molecula Corp. (DBA FeatureBase). SPDX-License-Identifier: Apache-2.0

Copyright 2022 Molecula Corp. (DBA FeatureBase). SPDX-License-Identifier: Apache-2.0

Copyright 2022 Molecula Corp. (DBA FeatureBase). SPDX-License-Identifier: Apache-2.0

Copyright 2022 Molecula Corp. (DBA FeatureBase). SPDX-License-Identifier: Apache-2.0

Copyright 2021 Molecula Corp. All rights reserved.

Copyright 2022 Molecula Corp. (DBA FeatureBase). SPDX-License-Identifier: Apache-2.0

Copyright 2022 Molecula Corp. (DBA FeatureBase). SPDX-License-Identifier: Apache-2.0

Copyright 2022 Molecula Corp. All rights reserved.

Copyright 2022 Molecula Corp. (DBA FeatureBase). SPDX-License-Identifier: Apache-2.0

Copyright 2022 Molecula Corp. (DBA FeatureBase). SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

View Source
var Exporter *ctl.ExportCommand
View Source
var Importer *ctl.ImportCommand
View Source
var Server *server.Command

Server is global so that tests can control and verify it.

Functions

func NewRootCommand

func NewRootCommand(stderr io.Writer) *cobra.Command

func SetAllConfig added in v3.34.0

func SetAllConfig(v *viper.Viper, flags *pflag.FlagSet, envPrefix string) error

SetAllConfig takes a FlagSet to be the definition of all configuration options, as well as their defaults. It then reads from the command line, the environment, and a config file (if specified), and applies the configuration in that priority order. Since each flag in the set contains a pointer to where its value should be stored, SetAllConfig can directly modify the value of each config variable.

SetAllConfig looks for environment variables which are capitalized versions of the flag names with dashes replaced by underscores, and prefixed with envPrefix plus an underscore.

func UsageErrorWrapper added in v3.34.0

func UsageErrorWrapper(inner runner) func(*cobra.Command, []string) error

UsageErrorWrapper takes a thing with a Run(context) error, and produces a func(*cobra.Command, []string) error from it which will run that command, and then set Cobra's SilenceUsage flag unless the returned error errors.Is() a ctl.UsageError.

Types

type DecimalFlagValue

type DecimalFlagValue struct {
	// contains filtered or unexported fields
}

DecimalFlagValue is used to set the unexported value field in a decimal. It also fulfills the flag.Value interface.

func (*DecimalFlagValue) Set

func (dfv *DecimalFlagValue) Set(s string) error

func (*DecimalFlagValue) String

func (dfv *DecimalFlagValue) String() string

func (*DecimalFlagValue) Type

func (dfv *DecimalFlagValue) Type() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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