flags

package
v0.1.37 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// OmittedDefaultFlagValue is used whenever a flag is required but no reasonable default value can be provided.
	// In most cases, this forces the user to specify the flag value to avoid unintended behavior.
	OmittedDefaultFlagValue = "intentionally omitting default"

	// DEV_NOTE: use cosmosflags.FlagGRPC for the flag name.
	FlagGRPCUsage = "" /* 208-byte string literal not displayed */

	// DEV_NOTE: use cosmosflags.FlagGRPCInsecure for the flag name.
	FlagGRPCInsecureUsage = "Allow gRPC over insecure channels, if not the server MUST be TLS terminated"

	// DEV_NOTE: use cosmosflags.FlagLogLevelUsage for the flag name.
	FlagLogLevelUsage = "The logging level (debug|info|warn|error)"
	DefaultLogLevel   = "info"

	FlagLogOutput      = "log-output"
	FlagLogOutputUsage = "The logging output (<path>|'discard'|'stderr'); defaults to stdout ('-')"
	DefaultLogOutput   = "-"

	FlagPassphrase      = "passphrase"
	FlagPassphraseShort = "p"
	FlagPassphraseUsage = "" /* 139-byte string literal not displayed */

	FlagNoPassphrase      = "no-passphrase"
	FlagNoPassphraseUsage = "attempt to use an empty passphrase to decrypt the exported Morse key file for signing"

	FlagInputFile      = "input-file"
	FlagInputFileUsage = "An absolute or relative path to an input file that can be used to read data from. This will not be overwritten."

	FlagOutputFile      = "output-file"
	FlagOutputFileUsage = "" /* 156-byte string literal not displayed */

	FlagNetwork      = "network"
	FlagNetworkUsage = "" /* 133-byte string literal not displayed */
	DefaultNetwork   = ""

	FlagFaucetBaseURL      = "base-url"
	FlagFaucetBaseURLUsage = "The base URL of the Pocket Network Faucet"
	// TODO_UP_NEXT(@bryanchriswhite): Update to the MainNet URL once available.
	DefaultFaucetBaseURL = "https://shannon-testnet-grove-faucet.beta.poktroll.com"

	FaucetConfigPath = "faucet-config-path"
	// TODO_UP_NEXT(@bryanchriswhite): explicitly set config.
	FaucetConfigPathUsage   = "Path to the faucet config yaml file ($HOME/.{pocket,poktroll} and PWD are searched by default)"
	DefaultFaucetConfigPath = ""

	FaucetListenAddress        = "listen-address"
	FaucetListenAddressUsage   = "The listen address of the Pocket Network Faucet in the form of host:port"
	DefaultFaucetListenAddress = "0.0.0.0:8080"

	LocalNetworkName = "local"
	AlphaNetworkName = "alpha"
	BetaNetworkName  = "beta"
	MainNetworkName  = "main"

	BooleanTrueValue  = "true"
	BooleanFalseValue = "false"

	// FlagQueryCaching is the flag name to enable or disable query caching.
	FlagQueryCaching        = "query-caching"
	FlagQueryCachingUsage   = "(Optional) Enable or disable onchain query caching"
	DefaultFlagQueryCaching = true

	// DefaultNodeRPCURL is the cosmos-sdk default --node flag value:
	// • Hard-coded in cosmos-sdk CLI and cannot be changed since registered by cosmos-sdk
	// • Used only for comparison, not flag registration
	// See: https://github.com/cosmos/cosmos-sdk/blob/v0.53.2/client/flags/flags.go#L108
	DefaultNodeRPCURL = "tcp://localhost:26657"
)

Variables

View Source
var (
	ErrFlagNotRegistered = cosmoserrors.Register(namespace, 1200, "flag not registered")
	ErrFlagInvalidValue  = cosmoserrors.Register(namespace, 1201, "flag value is invalid")
)

Functions

func GetFlag added in v0.1.29

func GetFlag(cmd *cobra.Command, flagName string) (*pflag.Flag, error)

GetFlag retrieves a flag instance from the command. Returns ErrFlagNotRegistered if the flag doesn't exist.

func GetFlagBool added in v0.1.29

func GetFlagBool(cmd *cobra.Command, flagName string) (bool, error)

GetFlagBool parses a flag's string value as a boolean. Returns error if flag is not registered or value is not 'true'/'false'.

func GetFlagValueString added in v0.1.29

func GetFlagValueString(cmd *cobra.Command, flagName string) (string, error)

GetFlagValueString retrieves the string value of a registered flag. Returns ErrFlagNotRegistered if the flag doesn't exist on the command.

Types

This section is empty.

Jump to

Keyboard shortcuts

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