diff --git a/README.md b/README.md index 2d16bd9..decbbdc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ff [![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/peterbourgon/ff) ![Latest Release](https://img.shields.io/github/v/release/peterbourgon/ff?style=flat-square) ![Build Status](https://github.com/peterbourgon/ff/actions/workflows/test.yml/badge.svg?branch=main) +# ff [![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/peterbourgon/ff/v3) [![Latest Release](https://img.shields.io/github/release/peterbourgon/ff.svg?style=flat-square)](https://github.com/peterbourgon/ff/releases/latest) [![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fpeterbourgon%2Fff%2Fbadge&style=flat-square&label=build)](https://github.com/peterbourgon/ff/actions?query=workflow%3ATest) ff stands for flags-first, and provides an opinionated way to populate a [flag.FlagSet](https://golang.org/pkg/flag#FlagSet) with configuration data from @@ -7,7 +7,7 @@ enable parsing from environment variables (lower priority) and/or a configuration file (lowest priority). Building a commandline application in the style of `kubectl` or `docker`? -Consider [package ffcli](https://pkg.go.dev/github.com/peterbourgon/ff/ffcli), +Consider [package ffcli](https://pkg.go.dev/github.com/peterbourgon/ff/v3/ffcli), a natural companion to, and extension of, package ff. ## Usage @@ -20,7 +20,7 @@ import ( "os" "time" - "github.com/peterbourgon/ff" + "github.com/peterbourgon/ff/v3" ) func main() { @@ -34,7 +34,7 @@ func main() { ``` Then, call ff.Parse instead of fs.Parse. -[Options](https://pkg.go.dev/github.com/peterbourgon/ff#Option) +[Options](https://pkg.go.dev/github.com/peterbourgon/ff/v3#Option) are available to control parse behavior. ```go @@ -95,7 +95,7 @@ import ( "fmt" "os" - "github.com/peterbourgon/ff" + "github.com/peterbourgon/ff/v3" ) func main() { diff --git a/ffcli/README.md b/ffcli/README.md index 65da4a5..aee199e 100644 --- a/ffcli/README.md +++ b/ffcli/README.md @@ -1,4 +1,4 @@ -# ffcli [![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/peterbourgon/ff/ffcli) +# ffcli [![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/peterbourgon/ff/v3/ffcli) ffcli stands for flags-first command line interface, and provides an opinionated way to build CLIs. @@ -60,7 +60,7 @@ import ( "context" "os" - "github.com/peterbourgon/ff/ffcli" + "github.com/peterbourgon/ff/v3/ffcli" ) func main() { diff --git a/ffcli/command.go b/ffcli/command.go index 12cbacb..ed83d19 100644 --- a/ffcli/command.go +++ b/ffcli/command.go @@ -8,7 +8,7 @@ import ( "strings" "text/tabwriter" - "github.com/peterbourgon/ff" + "github.com/peterbourgon/ff/v3" ) // Command combines a main function with a flag.FlagSet, and zero or more diff --git a/ffcli/command_test.go b/ffcli/command_test.go index 9dc8031..e1988cb 100644 --- a/ffcli/command_test.go +++ b/ffcli/command_test.go @@ -13,8 +13,8 @@ import ( "testing" "time" - "github.com/peterbourgon/ff/ffcli" - "github.com/peterbourgon/ff/fftest" + "github.com/peterbourgon/ff/v3/ffcli" + "github.com/peterbourgon/ff/v3/fftest" ) func TestCommandRun(t *testing.T) { diff --git a/ffcli/examples/objectctl/cmd/objectctl/main.go b/ffcli/examples/objectctl/cmd/objectctl/main.go index acbd18f..ec47ba1 100644 --- a/ffcli/examples/objectctl/cmd/objectctl/main.go +++ b/ffcli/examples/objectctl/cmd/objectctl/main.go @@ -5,12 +5,12 @@ import ( "fmt" "os" - "github.com/peterbourgon/ff/ffcli" - "github.com/peterbourgon/ff/ffcli/examples/objectctl/pkg/createcmd" - "github.com/peterbourgon/ff/ffcli/examples/objectctl/pkg/deletecmd" - "github.com/peterbourgon/ff/ffcli/examples/objectctl/pkg/listcmd" - "github.com/peterbourgon/ff/ffcli/examples/objectctl/pkg/objectapi" - "github.com/peterbourgon/ff/ffcli/examples/objectctl/pkg/rootcmd" + "github.com/peterbourgon/ff/v3/ffcli" + "github.com/peterbourgon/ff/v3/ffcli/examples/objectctl/pkg/createcmd" + "github.com/peterbourgon/ff/v3/ffcli/examples/objectctl/pkg/deletecmd" + "github.com/peterbourgon/ff/v3/ffcli/examples/objectctl/pkg/listcmd" + "github.com/peterbourgon/ff/v3/ffcli/examples/objectctl/pkg/objectapi" + "github.com/peterbourgon/ff/v3/ffcli/examples/objectctl/pkg/rootcmd" ) func main() { diff --git a/ffcli/examples/objectctl/pkg/createcmd/create.go b/ffcli/examples/objectctl/pkg/createcmd/create.go index e6dcbac..d3702fc 100644 --- a/ffcli/examples/objectctl/pkg/createcmd/create.go +++ b/ffcli/examples/objectctl/pkg/createcmd/create.go @@ -8,8 +8,8 @@ import ( "io" "strings" - "github.com/peterbourgon/ff/ffcli" - "github.com/peterbourgon/ff/ffcli/examples/objectctl/pkg/rootcmd" + "github.com/peterbourgon/ff/v3/ffcli" + "github.com/peterbourgon/ff/v3/ffcli/examples/objectctl/pkg/rootcmd" ) // Config for the create subcommand, including a reference to the API client. diff --git a/ffcli/examples/objectctl/pkg/deletecmd/delete.go b/ffcli/examples/objectctl/pkg/deletecmd/delete.go index c3771d1..94743d5 100644 --- a/ffcli/examples/objectctl/pkg/deletecmd/delete.go +++ b/ffcli/examples/objectctl/pkg/deletecmd/delete.go @@ -7,8 +7,8 @@ import ( "fmt" "io" - "github.com/peterbourgon/ff/ffcli" - "github.com/peterbourgon/ff/ffcli/examples/objectctl/pkg/rootcmd" + "github.com/peterbourgon/ff/v3/ffcli" + "github.com/peterbourgon/ff/v3/ffcli/examples/objectctl/pkg/rootcmd" ) // Config for the delete subcommand, including a reference to the API client. diff --git a/ffcli/examples/objectctl/pkg/listcmd/list.go b/ffcli/examples/objectctl/pkg/listcmd/list.go index 9d7e6d0..5d4b243 100644 --- a/ffcli/examples/objectctl/pkg/listcmd/list.go +++ b/ffcli/examples/objectctl/pkg/listcmd/list.go @@ -8,8 +8,8 @@ import ( "text/tabwriter" "time" - "github.com/peterbourgon/ff/ffcli" - "github.com/peterbourgon/ff/ffcli/examples/objectctl/pkg/rootcmd" + "github.com/peterbourgon/ff/v3/ffcli" + "github.com/peterbourgon/ff/v3/ffcli/examples/objectctl/pkg/rootcmd" ) // Config for the list subcommand, including a reference diff --git a/ffcli/examples/objectctl/pkg/rootcmd/root.go b/ffcli/examples/objectctl/pkg/rootcmd/root.go index 720ad26..329b7b3 100644 --- a/ffcli/examples/objectctl/pkg/rootcmd/root.go +++ b/ffcli/examples/objectctl/pkg/rootcmd/root.go @@ -4,8 +4,8 @@ import ( "context" "flag" - "github.com/peterbourgon/ff/ffcli" - "github.com/peterbourgon/ff/ffcli/examples/objectctl/pkg/objectapi" + "github.com/peterbourgon/ff/v3/ffcli" + "github.com/peterbourgon/ff/v3/ffcli/examples/objectctl/pkg/objectapi" ) // Config for the root command, including flags and types that should be diff --git a/ffcli/examples/textctl/textctl.go b/ffcli/examples/textctl/textctl.go index a8fe0b4..201daa9 100644 --- a/ffcli/examples/textctl/textctl.go +++ b/ffcli/examples/textctl/textctl.go @@ -6,7 +6,7 @@ import ( "fmt" "os" - "github.com/peterbourgon/ff/ffcli" + "github.com/peterbourgon/ff/v3/ffcli" ) // textctl is a simple applications in which all commands are built up in func diff --git a/fftoml/fftoml.go b/fftoml/fftoml.go index 50d6f1b..d57451d 100644 --- a/fftoml/fftoml.go +++ b/fftoml/fftoml.go @@ -7,7 +7,7 @@ import ( "strconv" "github.com/pelletier/go-toml" - "github.com/peterbourgon/ff" + "github.com/peterbourgon/ff/v3" ) // Parser is a parser for TOML file format. Flags and their values are read diff --git a/fftoml/fftoml_test.go b/fftoml/fftoml_test.go index 8c237f3..55de143 100644 --- a/fftoml/fftoml_test.go +++ b/fftoml/fftoml_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - "github.com/peterbourgon/ff" - "github.com/peterbourgon/ff/fftest" - "github.com/peterbourgon/ff/fftoml" + "github.com/peterbourgon/ff/v3" + "github.com/peterbourgon/ff/v3/fftest" + "github.com/peterbourgon/ff/v3/fftoml" ) func TestParser(t *testing.T) { diff --git a/ffyaml/ffyaml.go b/ffyaml/ffyaml.go index fac28f7..8fe88e4 100644 --- a/ffyaml/ffyaml.go +++ b/ffyaml/ffyaml.go @@ -6,7 +6,7 @@ import ( "io" "strconv" - "github.com/peterbourgon/ff" + "github.com/peterbourgon/ff/v3" "gopkg.in/yaml.v2" ) diff --git a/ffyaml/ffyaml_test.go b/ffyaml/ffyaml_test.go index 0fb75c4..7667c09 100644 --- a/ffyaml/ffyaml_test.go +++ b/ffyaml/ffyaml_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - "github.com/peterbourgon/ff" - "github.com/peterbourgon/ff/fftest" - "github.com/peterbourgon/ff/ffyaml" + "github.com/peterbourgon/ff/v3" + "github.com/peterbourgon/ff/v3/fftest" + "github.com/peterbourgon/ff/v3/ffyaml" ) func TestParser(t *testing.T) { diff --git a/go.mod b/go.mod index 66ba688..2000cb8 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/peterbourgon/ff +module github.com/peterbourgon/ff/v3 go 1.16 diff --git a/json_test.go b/json_test.go index 209ad12..39a1b90 100644 --- a/json_test.go +++ b/json_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "github.com/peterbourgon/ff" - "github.com/peterbourgon/ff/fftest" + "github.com/peterbourgon/ff/v3" + "github.com/peterbourgon/ff/v3/fftest" ) func TestJSONParser(t *testing.T) { diff --git a/parse_test.go b/parse_test.go index f53c99c..8524c5b 100644 --- a/parse_test.go +++ b/parse_test.go @@ -7,9 +7,9 @@ import ( "testing" "time" - "github.com/peterbourgon/ff" - "github.com/peterbourgon/ff/ffcli" - "github.com/peterbourgon/ff/fftest" + "github.com/peterbourgon/ff/v3" + "github.com/peterbourgon/ff/v3/ffcli" + "github.com/peterbourgon/ff/v3/fftest" ) func TestParseBasics(t *testing.T) { @@ -305,4 +305,5 @@ func TestParseConfigFileVia(t *testing.T) { if want, have := 99, *i; want != have { t.Errorf("i: want %d, have %d", want, have) } + }