{"modulePath":"github.com/RNSSolution/prism","version":"v0.31.5","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cli\n\n## Constants\n\n```go\nconst (\n\tHomeFlag     = \"home\"\n\tTraceFlag    = \"trace\"\n\tOutputFlag   = \"output\"\n\tEncodingFlag = \"encoding\"\n)\n```\n\n## Functions\n\n```go\nfunc RunCaptureWithArgs(cmd Executable, args []string, env map[string]string) (stdout, stderr string, err error)\n```\nRunCaptureWithArgs executes the given command with the specified command line args and environmental variables set. It returns string fields representing output written to stdout and stderr, additionally any error from cmd.Execute() is also returned\n\n```go\nfunc RunWithArgs(cmd Executable, args []string, env map[string]string) error\n```\nRunWithArgs executes the given command with the specified command line args and environmental variables set. It returns any error returned from cmd.Execute()\n\n```go\nfunc WriteConfigVals(dir string, vals map[string]string) error\n```\nWriteConfigVals writes a toml file with the given values. It returns an error if writing was impossible.\n\n## Types\n\n```go\ntype Executable interface {\n\tExecute() error\n}\n```\nExecutable is the minimal interface to \\*corba.Command, so we can wrap if desired before the test\n\n```go\ntype Executor struct {\n\t*cobra.Command\n\tExit func(int) // this is os.Exit by default, override in tests\n}\n```\nExecutor wraps the cobra Command with a nicer Execute method\n\n```go\nfunc PrepareBaseCmd(cmd *cobra.Command, envPrefix, defaultHome string) Executor\n```\nPrepareBaseCmd is meant for tendermint and other servers\n\n```go\nfunc PrepareMainCmd(cmd *cobra.Command, envPrefix, defaultHome string) Executor\n```\nPrepareMainCmd is meant for client side libs that want some more flags\n\nThis adds --encoding (hex, btc, base64) and --output (text, json) to the command.  These only really make sense in interactive commands.\n\n```go\nfunc (e Executor) Execute() error\n```\nexecute adds all child commands to the root command sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.\n\n```go\ntype ExitCoder interface {\n\tExitCode() int\n}\n```\n\n","path":"github.com/RNSSolution/prism/libs/cli","name":"cli","synopsis":"","isRedistributable":true}
