Skip to content
/ ccli Public
forked from saschagrunert/ccli

Command line parsing in go, with coloring support 🌈

License

Notifications You must be signed in to change notification settings

KateGo520/ccli

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ccli 🌈

Build Status godoc ccli godoc ccli

Command line parsing in go, with coloring support

This project uses the already existing go package cli and adds additional coloring support to it. Some strong defaults are provided as well.

screenshot

Usage

Install the package with:

go get github.com/saschagrunert/ccli

Afterwards it can be used like the cli package:

package main

import (
	"fmt"
	"os"
	"time"

	"github.com/saschagrunert/ccli"
	"github.com/urfave/cli/v2"
)

func main() {
	app := ccli.NewApp()
	app.Name = "AppName"
	app.Usage = "App usage..."
	app.Version = "0.1.0"
	app.Description = "Application description"
	app.Copyright = fmt.Sprintf("© %d Some Company", time.Now().Year())
	app.Authors = []cli.Author{{Name: "Name", Email: "[email protected]"}}
	app.Flags = []cli.Flag{
		cli.StringFlag{
			Name:  "lang",
			Value: "english",
			Usage: "language for the greeting",
		},
	}
	app.Action = func(c *cli.Context) error {
		fmt.Println("boom! I say!")
		return nil
	}
	if err := app.Run(os.Args); err != nil {
		os.Exit(1)
	}
}

About

Command line parsing in go, with coloring support 🌈

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 90.1%
  • Makefile 9.9%