Skip to content

Instantly share code, notes, and snippets.

@binitshah
Created July 17, 2017 21:23
Show Gist options
  • Save binitshah/e4a638d238e2e053fe9b670b1d35fd12 to your computer and use it in GitHub Desktop.
Save binitshah/e4a638d238e2e053fe9b670b1d35fd12 to your computer and use it in GitHub Desktop.
CLI app in golang. How awesome is that?
/*
* haha.go
*
* Author: Binit Shah
* Description: Messing around with cli fun.
*/
package main
import (
"fmt"
"os"
"github.com/urfave/cli"
)
func main() {
app := cli.NewApp()
app.Name = "haha"
app.Usage = "i tell funny jokes."
app.Action = func(c *cli.Context) error {
fmt.Println("Velcro... what a ripoff!")
return nil
}
app.Run(os.Args)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment