GitXplorerGitXplorer
c

fuego

public
39 stars
6 forks
3 issues

Commits

List of commits on branch master.
Unverified
5c764e5fce05ab2cbf8452ebcf3b4c8b441f95ac

add methodhelp docs to lowcase methodName

ssherylynn committed 6 years ago
Unverified
b8ed8daee2f99f6a33f8fa2456d5e3b2815ba31a

add support for lowcase methodName

ssherylynn committed 6 years ago
Unverified
9208f8db1685377e8e8f28756f5fa805ea6ffd13

fire: Update help printing

ccorona10 committed 6 years ago
Unverified
a1d3eef5949e14982eeee2737b381b3d197deee6

fuego: Update README.md

ccorona10 committed 6 years ago
Unverified
04c66531dbc90696f4f349a5940924e6dd7f013c

fuego: Update README.md

ccorona10 committed 6 years ago
Unverified
ab28790301479e9becb5fd55d75e9b6e060af19c

fuego: Update README.md

ccorona10 committed 6 years ago

README

The README file for this repository.

Build Status GoDoc Go Report Card Coverage Status License

fuego

Inspired by Google python-fire

fuego is a library for automatically generating command line interfaces (CLIs) from function and struct.

Features

  • fuego is a simple way to create a CLI in Go.
  • fuego helps with exploring existing code or turning other people's code into a CLI. [1]
  • fuego shows documentation of each method or functions for help.

Installation

go get github.com/corona10/fuego

TODO

  • Support flag options
  • More error handling
  • Support more types

asciicast

package main

import (
	"fmt"

	"github.com/corona10/fuego"
)

func Add(a int, b int) (int, int) {
	fmt.Println(a, b)
	return a + b, 2*a + b
}

func main() {
	fuego.Fire(Add)
}
package main

import (
	"fmt"

	"github.com/corona10/fuego"
)

type Sample struct {
	Name string
}

func (s Sample) Add(a, b int) int {
	return a + b
}

func (s Sample) Minus(a, b int) int {
	return a - b
}

func (s Sample) HelloWorld() {
	fmt.Println(s.Name)
	fmt.Println("Hello world!")
}

func main() {
	var s Sample
	s.Name = "test"
	fuego.Fire(s)
}

Special thanks to