Merge branch 'master' into master
This commit is contained in:
commit
11c9e598b0
@ -1 +1,4 @@
|
|||||||
- @meatballhat
|
- @meatballhat
|
||||||
|
- @lynncyrin
|
||||||
|
- @AudriusButkevicius
|
||||||
|
- @asahasrabuddhe
|
||||||
|
@ -874,7 +874,7 @@ Will include:
|
|||||||
|
|
||||||
```
|
```
|
||||||
COMMANDS:
|
COMMANDS:
|
||||||
noop
|
noop
|
||||||
|
|
||||||
Template actions:
|
Template actions:
|
||||||
add
|
add
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"gopkg.in/urfave/cli.v1"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
// FlagInputSourceExtension is an extension interface of cli.Flag that
|
// FlagInputSourceExtension is an extension interface of cli.Flag that
|
||||||
|
@ -3,7 +3,7 @@ package altsrc
|
|||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
|
|
||||||
"gopkg.in/urfave/cli.v1"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
// WARNING: This file is generated!
|
// WARNING: This file is generated!
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"gopkg.in/urfave/cli.v1"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
type testApplyInputSource struct {
|
type testApplyInputSource struct {
|
||||||
|
@ -3,7 +3,7 @@ package altsrc
|
|||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"gopkg.in/urfave/cli.v1"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
// InputSourceContext is an interface used to allow
|
// InputSourceContext is an interface used to allow
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"gopkg.in/urfave/cli.v1"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"gopkg.in/urfave/cli.v1"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewJSONSourceFromFlagFunc returns a func that takes a cli.Context
|
// NewJSONSourceFromFlagFunc returns a func that takes a cli.Context
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"gopkg.in/urfave/cli.v1"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
// MapInputSource implements InputSourceContext to return
|
// MapInputSource implements InputSourceContext to return
|
||||||
|
@ -11,7 +11,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"gopkg.in/urfave/cli.v1"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCommandTomFileTest(t *testing.T) {
|
func TestCommandTomFileTest(t *testing.T) {
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
|
|
||||||
"github.com/BurntSushi/toml"
|
"github.com/BurntSushi/toml"
|
||||||
"gopkg.in/urfave/cli.v1"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
type tomlMap struct {
|
type tomlMap struct {
|
||||||
|
@ -11,7 +11,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"gopkg.in/urfave/cli.v1"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCommandYamlFileTest(t *testing.T) {
|
func TestCommandYamlFileTest(t *testing.T) {
|
||||||
|
@ -14,7 +14,7 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"gopkg.in/urfave/cli.v1"
|
"github.com/urfave/cli"
|
||||||
|
|
||||||
"gopkg.in/yaml.v2"
|
"gopkg.in/yaml.v2"
|
||||||
)
|
)
|
||||||
|
@ -136,8 +136,8 @@ func ExampleApp_Run_appHelp() {
|
|||||||
// Oliver Allen <oliver@toyshop.com>
|
// Oliver Allen <oliver@toyshop.com>
|
||||||
//
|
//
|
||||||
// COMMANDS:
|
// COMMANDS:
|
||||||
// describeit, d use it to see a description
|
// describeit, d use it to see a description
|
||||||
// help, h Shows a list of commands or help for one command
|
// help, h Shows a list of commands or help for one command
|
||||||
//
|
//
|
||||||
// GLOBAL OPTIONS:
|
// GLOBAL OPTIONS:
|
||||||
// --name value a name to say (default: "bob")
|
// --name value a name to say (default: "bob")
|
||||||
@ -190,7 +190,7 @@ func ExampleApp_Run_noAction() {
|
|||||||
// [global options] command [command options] [arguments...]
|
// [global options] command [command options] [arguments...]
|
||||||
//
|
//
|
||||||
// COMMANDS:
|
// COMMANDS:
|
||||||
// help, h Shows a list of commands or help for one command
|
// help, h Shows a list of commands or help for one command
|
||||||
//
|
//
|
||||||
// GLOBAL OPTIONS:
|
// GLOBAL OPTIONS:
|
||||||
// --help, -h show help
|
// --help, -h show help
|
||||||
|
8
go.mod
Normal file
8
go.mod
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
module github.com/urfave/cli
|
||||||
|
|
||||||
|
go 1.12
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/BurntSushi/toml v0.3.1
|
||||||
|
gopkg.in/yaml.v2 v2.2.2
|
||||||
|
)
|
6
go.sum
Normal file
6
go.sum
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
|
||||||
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||||
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
|
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
|
||||||
|
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
19
help.go
19
help.go
@ -32,8 +32,9 @@ AUTHOR{{with $length := len .Authors}}{{if ne 1 $length}}S{{end}}{{end}}:
|
|||||||
|
|
||||||
COMMANDS:{{range .VisibleCategories}}{{if .Name}}
|
COMMANDS:{{range .VisibleCategories}}{{if .Name}}
|
||||||
|
|
||||||
{{.Name}}:{{end}}{{range .VisibleCommands}}
|
{{.Name}}:{{range .VisibleCommands}}
|
||||||
{{join .Names ", "}}{{"\t"}}{{.Usage}}{{end}}{{end}}{{end}}{{if .VisibleFlags}}
|
{{join .Names ", "}}{{"\t"}}{{.Usage}}{{end}}{{else}}{{range .VisibleCommands}}
|
||||||
|
{{join .Names ", "}}{{"\t"}}{{.Usage}}{{end}}{{end}}{{end}}{{end}}{{if .VisibleFlags}}
|
||||||
|
|
||||||
GLOBAL OPTIONS:
|
GLOBAL OPTIONS:
|
||||||
{{range $index, $option := .VisibleFlags}}{{if $index}}
|
{{range $index, $option := .VisibleFlags}}{{if $index}}
|
||||||
@ -73,9 +74,11 @@ USAGE:
|
|||||||
{{if .UsageText}}{{.UsageText}}{{else}}{{.HelpName}} command{{if .VisibleFlags}} [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}{{end}}
|
{{if .UsageText}}{{.UsageText}}{{else}}{{.HelpName}} command{{if .VisibleFlags}} [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}{{end}}
|
||||||
|
|
||||||
COMMANDS:{{range .VisibleCategories}}{{if .Name}}
|
COMMANDS:{{range .VisibleCategories}}{{if .Name}}
|
||||||
{{.Name}}:{{end}}{{range .VisibleCommands}}
|
|
||||||
{{join .Names ", "}}{{"\t"}}{{.Usage}}{{end}}
|
{{.Name}}:{{range .VisibleCommands}}
|
||||||
{{end}}{{if .VisibleFlags}}
|
{{join .Names ", "}}{{"\t"}}{{.Usage}}{{end}}{{else}}{{range .VisibleCommands}}
|
||||||
|
{{join .Names ", "}}{{"\t"}}{{.Usage}}{{end}}{{end}}{{end}}{{if .VisibleFlags}}
|
||||||
|
|
||||||
OPTIONS:
|
OPTIONS:
|
||||||
{{range .VisibleFlags}}{{.}}
|
{{range .VisibleFlags}}{{.}}
|
||||||
{{end}}{{end}}
|
{{end}}{{end}}
|
||||||
@ -311,10 +314,8 @@ func printHelpCustom(out io.Writer, templ string, data interface{}, customFunc m
|
|||||||
funcMap := template.FuncMap{
|
funcMap := template.FuncMap{
|
||||||
"join": strings.Join,
|
"join": strings.Join,
|
||||||
}
|
}
|
||||||
if customFunc != nil {
|
for key, value := range customFunc {
|
||||||
for key, value := range customFunc {
|
funcMap[key] = value
|
||||||
funcMap[key] = value
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
w := tabwriter.NewWriter(out, 1, 8, 2, ' ', 0)
|
w := tabwriter.NewWriter(out, 1, 8, 2, ' ', 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user