From 0aaa7b53701a6b75b571e47dd94a4d90232b31f7 Mon Sep 17 00:00:00 2001 From: Peter Bourgon Date: Tue, 28 Sep 2021 00:47:58 +0200 Subject: [PATCH] v0 --- README.md | 10 +++++----- ffcli/README.md | 4 ++-- ffcli/command.go | 2 +- ffcli/command_test.go | 4 ++-- ffcli/examples/objectctl/cmd/objectctl/main.go | 12 ++++++------ ffcli/examples/objectctl/pkg/createcmd/create.go | 4 ++-- ffcli/examples/objectctl/pkg/deletecmd/delete.go | 4 ++-- ffcli/examples/objectctl/pkg/listcmd/list.go | 4 ++-- ffcli/examples/objectctl/pkg/rootcmd/root.go | 4 ++-- ffcli/examples/textctl/textctl.go | 2 +- fftoml/fftoml.go | 2 +- fftoml/fftoml_test.go | 6 +++--- ffyaml/ffyaml.go | 2 +- ffyaml/ffyaml_test.go | 6 +++--- go.mod | 2 +- json_test.go | 4 ++-- parse_test.go | 7 +++---- 17 files changed, 39 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index decbbdc..cc06e28 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/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 [![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/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/v3/ffcli), +Consider [package ffcli](https://pkg.go.dev/github.com/peterbourgon/ff/ffcli), a natural companion to, and extension of, package ff. ## Usage @@ -20,7 +20,7 @@ import ( "os" "time" - "github.com/peterbourgon/ff/v3" + "github.com/peterbourgon/ff" ) 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/v3#Option) +[Options](https://pkg.go.dev/github.com/peterbourgon/ff#Option) are available to control parse behavior. ```go @@ -95,7 +95,7 @@ import ( "fmt" "os" - "github.com/peterbourgon/ff/v3" + "github.com/peterbourgon/ff" ) func main() { diff --git a/ffcli/README.md b/ffcli/README.md index aee199e..65da4a5 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/v3/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/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/v3/ffcli" + "github.com/peterbourgon/ff/ffcli" ) func main() { diff --git a/ffcli/command.go b/ffcli/command.go index ed83d19..12cbacb 100644 --- a/ffcli/command.go +++ b/ffcli/command.go @@ -8,7 +8,7 @@ import ( "strings" "text/tabwriter" - "github.com/peterbourgon/ff/v3" + "github.com/peterbourgon/ff" ) // 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 e1988cb..9dc8031 100644 --- a/ffcli/command_test.go +++ b/ffcli/command_test.go @@ -13,8 +13,8 @@ import ( "testing" "time" - "github.com/peterbourgon/ff/v3/ffcli" - "github.com/peterbourgon/ff/v3/fftest" + "github.com/peterbourgon/ff/ffcli" + "github.com/peterbourgon/ff/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 ec47ba1..acbd18f 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/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" + "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" ) func main() { diff --git a/ffcli/examples/objectctl/pkg/createcmd/create.go b/ffcli/examples/objectctl/pkg/createcmd/create.go index d3702fc..e6dcbac 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/v3/ffcli" - "github.com/peterbourgon/ff/v3/ffcli/examples/objectctl/pkg/rootcmd" + "github.com/peterbourgon/ff/ffcli" + "github.com/peterbourgon/ff/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 94743d5..c3771d1 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/v3/ffcli" - "github.com/peterbourgon/ff/v3/ffcli/examples/objectctl/pkg/rootcmd" + "github.com/peterbourgon/ff/ffcli" + "github.com/peterbourgon/ff/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 5d4b243..9d7e6d0 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/v3/ffcli" - "github.com/peterbourgon/ff/v3/ffcli/examples/objectctl/pkg/rootcmd" + "github.com/peterbourgon/ff/ffcli" + "github.com/peterbourgon/ff/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 329b7b3..720ad26 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/v3/ffcli" - "github.com/peterbourgon/ff/v3/ffcli/examples/objectctl/pkg/objectapi" + "github.com/peterbourgon/ff/ffcli" + "github.com/peterbourgon/ff/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 201daa9..a8fe0b4 100644 --- a/ffcli/examples/textctl/textctl.go +++ b/ffcli/examples/textctl/textctl.go @@ -6,7 +6,7 @@ import ( "fmt" "os" - "github.com/peterbourgon/ff/v3/ffcli" + "github.com/peterbourgon/ff/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 d57451d..50d6f1b 100644 --- a/fftoml/fftoml.go +++ b/fftoml/fftoml.go @@ -7,7 +7,7 @@ import ( "strconv" "github.com/pelletier/go-toml" - "github.com/peterbourgon/ff/v3" + "github.com/peterbourgon/ff" ) // 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 55de143..8c237f3 100644 --- a/fftoml/fftoml_test.go +++ b/fftoml/fftoml_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - "github.com/peterbourgon/ff/v3" - "github.com/peterbourgon/ff/v3/fftest" - "github.com/peterbourgon/ff/v3/fftoml" + "github.com/peterbourgon/ff" + "github.com/peterbourgon/ff/fftest" + "github.com/peterbourgon/ff/fftoml" ) func TestParser(t *testing.T) { diff --git a/ffyaml/ffyaml.go b/ffyaml/ffyaml.go index 8fe88e4..fac28f7 100644 --- a/ffyaml/ffyaml.go +++ b/ffyaml/ffyaml.go @@ -6,7 +6,7 @@ import ( "io" "strconv" - "github.com/peterbourgon/ff/v3" + "github.com/peterbourgon/ff" "gopkg.in/yaml.v2" ) diff --git a/ffyaml/ffyaml_test.go b/ffyaml/ffyaml_test.go index 7667c09..0fb75c4 100644 --- a/ffyaml/ffyaml_test.go +++ b/ffyaml/ffyaml_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - "github.com/peterbourgon/ff/v3" - "github.com/peterbourgon/ff/v3/fftest" - "github.com/peterbourgon/ff/v3/ffyaml" + "github.com/peterbourgon/ff" + "github.com/peterbourgon/ff/fftest" + "github.com/peterbourgon/ff/ffyaml" ) func TestParser(t *testing.T) { diff --git a/go.mod b/go.mod index 2000cb8..66ba688 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/peterbourgon/ff/v3 +module github.com/peterbourgon/ff go 1.16 diff --git a/json_test.go b/json_test.go index 39a1b90..209ad12 100644 --- a/json_test.go +++ b/json_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "github.com/peterbourgon/ff/v3" - "github.com/peterbourgon/ff/v3/fftest" + "github.com/peterbourgon/ff" + "github.com/peterbourgon/ff/fftest" ) func TestJSONParser(t *testing.T) { diff --git a/parse_test.go b/parse_test.go index 8524c5b..f53c99c 100644 --- a/parse_test.go +++ b/parse_test.go @@ -7,9 +7,9 @@ import ( "testing" "time" - "github.com/peterbourgon/ff/v3" - "github.com/peterbourgon/ff/v3/ffcli" - "github.com/peterbourgon/ff/v3/fftest" + "github.com/peterbourgon/ff" + "github.com/peterbourgon/ff/ffcli" + "github.com/peterbourgon/ff/fftest" ) func TestParseBasics(t *testing.T) { @@ -305,5 +305,4 @@ func TestParseConfigFileVia(t *testing.T) { if want, have := 99, *i; want != have { t.Errorf("i: want %d, have %d", want, have) } - }