Categorygithub.com/landoop/bite
modulepackage
0.0.0-20201125135013-f88b399f1cad
Repository: https://github.com/landoop/bite.git
Documentation: pkg.go.dev

# README

Bite

A toolbox for cobra-based command line applications.

build status report card

Installation

The only requirement is the Go Programming Language, at least version 1.10.

$ go get -u github.com/lensesio/bite

Table of Contents

Work in progress...

Versioning

Current: v0.0.1

Read more about Semantic Versioning 2.0.0

License

Distributed under Apache Version 2.0 License, click here for more details.

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
CanBeSilent registeres the `--silent` flag to the "cmd" command.
No description provided by the author
CheckRequiredFlags function can be used to manually check for required flags, when the command does not specify a required flag (mostly because of file loading feature).
CountRegisteredFlags returns the length of the registered flags (except help), some of them may not be used "now" at all.
No description provided by the author
ExecuteWithSpinner will make the spinner visible until first output from a command.
ExpectsFeedback returns true if the "cmd" command's `--silent` flag is registered and it's true, or the `--output` is table.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
GetSilentFlag returns the value(true/false) of the `--silent` flag, however if not found it returns false too.
HasFlag returns true if "flagName" can be found in the "cmd" cobra or its parents, otherwise false.
HasSilentFlag returns true if the "cmd" command has registered the `--silent` flag.
No description provided by the author
No description provided by the author
LoadFile same as `tryReadFile` but it should be used for operations that we read the whole object from file, not just a sub property of it like `--config ./configs.json`.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
OutlineIntResults accepts a key, i.e "version" and entries i.e [1, 2, 3] and will convert it to a slice of [{"version":3},"version":1, "version":2}] to be able to be printed via `printJSON`.
OutlineStringResults accepts a key, i.e "name" and entries i.e ["schema1", "schema2", "schema3"] and will convert it to a slice of [{"name":"schema1"},"name":"schema2", "name":"schema3"}] to be able to be printed via `printJSON`.
No description provided by the author
PrintInfo prints an info message to the command's standard output.
No description provided by the author
No description provided by the author
ReadInPipe reads from the input pipe.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
TryReadFile will try to check if a flag value begins with 'flagFilePrefix' if so, then it will json parse its contents, decode them and set to the `outPtr`, otherwise it will decode the flagvalue using json unmarshaler and send the result to the `outPtr`.
TryReadFileContents will try to check if a flag value begins with 'flagFilePrefix' if so then it returns the contents of the filename given from the flagValue after the 'flagFilePrefix' character.
No description provided by the author
No description provided by the author

# Variables

No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
Supported custom types underline are: strings, ints and booleans only.
No description provided by the author
Memory describes a temporary storage for each application, useful to store different kind of custom values.

# Interfaces

No description provided by the author

# Type aliases

No description provided by the author
FlagPair is just a map[string]interface{}, see `CheckRequiredFlags` for more.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author