ccli

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2017 License: MIT Imports: 4 Imported by: 0

README

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"
	"github.com/saschagrunert/ccli"
	"github.com/urfave/cli"
	"os"
	"time"
)

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{cli.Author{Name: "Name", Email: "e@mail.com"}}
	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
	}
	app.Run(os.Args)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewApp

func NewApp() *cli.App

NewApp creates a new applications with the given settings

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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