2016-06-16 15:47:19 +00:00
|
|
|
cli
|
|
|
|
===
|
|
|
|
|
2016-05-22 21:42:23 +00:00
|
|
|
[![Build Status](https://travis-ci.org/urfave/cli.svg?branch=master)](https://travis-ci.org/urfave/cli)
|
2016-06-01 14:46:39 +00:00
|
|
|
[![Windows Build Status](https://ci.appveyor.com/api/projects/status/rtgk5xufi932pb2v?svg=true)](https://ci.appveyor.com/project/urfave/cli)
|
2019-08-07 07:08:17 +00:00
|
|
|
|
2016-05-22 21:42:23 +00:00
|
|
|
[![GoDoc](https://godoc.org/github.com/urfave/cli?status.svg)](https://godoc.org/github.com/urfave/cli)
|
|
|
|
[![codebeat](https://codebeat.co/badges/0a8f30aa-f975-404b-b878-5fab3ae1cc5f)](https://codebeat.co/projects/github-com-urfave-cli)
|
|
|
|
[![Go Report Card](https://goreportcard.com/badge/urfave/cli)](https://goreportcard.com/report/urfave/cli)
|
2019-08-07 15:30:07 +00:00
|
|
|
[![codecov](https://codecov.io/gh/urfave/cli/branch/master/graph/badge.svg)](https://codecov.io/gh/urfave/cli)
|
2016-05-10 18:40:56 +00:00
|
|
|
|
2016-05-31 19:49:48 +00:00
|
|
|
cli is a simple, fast, and fun package for building command line apps in Go. The
|
|
|
|
goal is to enable developers to write fast and distributable command line
|
|
|
|
applications in an expressive way.
|
2013-07-15 01:01:26 +00:00
|
|
|
|
2013-07-15 14:44:17 +00:00
|
|
|
## Installation
|
2016-01-29 01:42:14 +00:00
|
|
|
|
2019-08-24 21:44:56 +00:00
|
|
|
Make sure you have a working Go environment. Go version 1.10+ is supported. [See
|
2016-07-11 09:16:14 +00:00
|
|
|
the install instructions for Go](http://golang.org/doc/install.html).
|
2013-07-15 14:44:17 +00:00
|
|
|
|
2019-09-16 03:41:43 +00:00
|
|
|
### GOPATH
|
2013-07-15 15:06:43 +00:00
|
|
|
|
2016-07-11 09:16:14 +00:00
|
|
|
Make sure your `PATH` includes the `$GOPATH/bin` directory so your commands can
|
|
|
|
be easily used:
|
2013-07-15 15:06:43 +00:00
|
|
|
```
|
|
|
|
export PATH=$PATH:$GOPATH/bin
|
|
|
|
```
|
|
|
|
|
2016-05-24 00:34:33 +00:00
|
|
|
### Supported platforms
|
|
|
|
|
|
|
|
cli is tested against multiple versions of Go on Linux, and against the latest
|
|
|
|
released version of Go on OS X and Windows. For full details, see
|
|
|
|
[`./.travis.yml`](./.travis.yml) and [`./appveyor.yml`](./appveyor.yml).
|
|
|
|
|
2019-08-14 04:10:38 +00:00
|
|
|
### Using `v1` releases
|
2016-05-16 14:46:43 +00:00
|
|
|
|
2019-08-15 19:30:29 +00:00
|
|
|
```
|
2019-08-14 18:20:58 +00:00
|
|
|
$ go get github.com/urfave/cli
|
2019-08-15 19:30:29 +00:00
|
|
|
```
|
2019-08-14 18:20:58 +00:00
|
|
|
|
2019-08-15 19:30:29 +00:00
|
|
|
```go
|
|
|
|
...
|
2019-08-14 18:20:58 +00:00
|
|
|
import (
|
|
|
|
"github.com/urfave/cli"
|
|
|
|
)
|
2019-08-15 19:30:29 +00:00
|
|
|
...
|
|
|
|
```
|
2016-05-16 14:46:43 +00:00
|
|
|
|
2019-09-16 03:41:43 +00:00
|
|
|
### Using `v2` releases
|
2016-09-03 20:18:48 +00:00
|
|
|
|
2019-09-16 03:41:43 +00:00
|
|
|
**Warning**: `v2` is in a pre-release state.
|
2016-05-31 19:49:48 +00:00
|
|
|
|
2015-12-09 17:15:46 +00:00
|
|
|
```
|
2019-09-16 03:41:43 +00:00
|
|
|
$ go get gopkg.in/urfave/cli.v2
|
2013-07-20 22:58:51 +00:00
|
|
|
```
|
2013-07-15 15:19:49 +00:00
|
|
|
|
2016-03-20 19:18:28 +00:00
|
|
|
```go
|
2019-09-16 03:41:43 +00:00
|
|
|
...
|
2016-06-01 17:28:27 +00:00
|
|
|
import (
|
2019-09-16 03:41:43 +00:00
|
|
|
"github.com/urfave/cli" // imports as package "cli"
|
2016-06-01 17:28:27 +00:00
|
|
|
)
|
2019-09-16 03:41:43 +00:00
|
|
|
...
|
2016-06-01 17:28:27 +00:00
|
|
|
```
|