Skip to content

Commit

Permalink
v0 reset isn't viable
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbourgon committed Sep 28, 2021
1 parent d2ce410 commit c40b025
Show file tree
Hide file tree
Showing 17 changed files with 40 additions and 39 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -20,7 +20,7 @@ import (
"os"
"time"

"github.com/peterbourgon/ff"
"github.com/peterbourgon/ff/v3"
)

func main() {
Expand All @@ -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
Expand Down Expand Up @@ -95,7 +95,7 @@ import (
"fmt"
"os"

"github.com/peterbourgon/ff"
"github.com/peterbourgon/ff/v3"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions ffcli/README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -60,7 +60,7 @@ import (
"context"
"os"

"github.com/peterbourgon/ff/ffcli"
"github.com/peterbourgon/ff/v3/ffcli"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion ffcli/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ffcli/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
12 changes: 6 additions & 6 deletions ffcli/examples/objectctl/cmd/objectctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions ffcli/examples/objectctl/pkg/createcmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions ffcli/examples/objectctl/pkg/deletecmd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions ffcli/examples/objectctl/pkg/listcmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ffcli/examples/objectctl/pkg/rootcmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ffcli/examples/textctl/textctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion fftoml/fftoml.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions fftoml/fftoml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion ffyaml/ffyaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"io"
"strconv"

"github.com/peterbourgon/ff"
"github.com/peterbourgon/ff/v3"
"gopkg.in/yaml.v2"
)

Expand Down
6 changes: 3 additions & 3 deletions ffyaml/ffyaml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/peterbourgon/ff
module github.com/peterbourgon/ff/v3

go 1.16

Expand Down
4 changes: 2 additions & 2 deletions json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
7 changes: 4 additions & 3 deletions parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
}

}

0 comments on commit c40b025

Please sign in to comment.