fuego

package module
v0.0.0-...-66866bf Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2020 License: MIT Imports: 7 Imported by: 0

README

Build Status Coverage Status

Fuego

Fuego is a library for automatically generating command line interfaces (CLIs) from golang functions and structs

Concepts derived from and inspired by Google python-fire

Features

  • quickly run and test your functions from the command line
  • show documentation for functions and struct methods from the command line (NOT YET)
  • run / test existing external library functions or just use them as a cli
  • turn external libraries into a simple CLI in as little as 4 lines
  • pass struct attribute values as CLI arguments --<attribute>=<value>

Installation

go get github.com/irasekh3/fuego

Documentation

Index

Constants

View Source
const (
	MethodDoesNotExistError                      = "the method \"%v\" for struct \"%v\" does not exist"
	UnsupportedTargetTypeError                   = "passing in \"%v\" is not yet supported"
	InsufficientArgumentsError                   = "not enough arguments were passed in to setup the function parameter values"
	ParameterListGenerationError                 = "could not generate the necessary function parameters list"
	CannotConvertToDesiredValueTypeError         = "cannot convert \"%v\" to \"%v\" as needed"
	UnsupportedConversionToDesiredValueTypeError = "fuego does not yet support converting attributes of type \"%v\""
)

Variables

View Source
var (
	// PrintToStdOut is used to determine if results should be printed to std out. Default is true but can be set to false prior to calling Fuego()
	PrintToStdOut = true
	// PrintToStdErr is used to determine if errors should be printed to std err. Default is true but can be set to false prior to calling Fuego()
	PrintToStdErr = true
)

Functions

func Fuego

func Fuego(targets interface{}) ([]reflect.Value, error)

Fuego handles the parsing of potential targets to call and then reflectively calls the function with all necessary params

Types

This section is empty.

Jump to

Keyboard shortcuts

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