Skip to content

Commit

Permalink
v0
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbourgon committed Sep 27, 2021
1 parent 17a8312 commit 0aaa7b5
Show file tree
Hide file tree
Showing 17 changed files with 39 additions and 40 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/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
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/v3/ffcli),
Consider [package ffcli](https://pkg.go.dev/github.com/peterbourgon/ff/ffcli),
a natural companion to, and extension of, package ff.

## Usage
Expand All @@ -20,7 +20,7 @@ import (
"os"
"time"

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

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/v3#Option)
[Options](https://pkg.go.dev/github.com/peterbourgon/ff#Option)
are available to control parse behavior.
```go
Expand Down Expand Up @@ -95,7 +95,7 @@ import (
"fmt"
"os"

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

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/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.
Expand Down Expand Up @@ -60,7 +60,7 @@ import (
"context"
"os"

"github.com/peterbourgon/ff/v3/ffcli"
"github.com/peterbourgon/ff/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/v3"
"github.com/peterbourgon/ff"
)

// 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/v3/ffcli"
"github.com/peterbourgon/ff/v3/fftest"
"github.com/peterbourgon/ff/ffcli"
"github.com/peterbourgon/ff/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/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() {
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/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.
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/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.
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/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
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/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
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/v3/ffcli"
"github.com/peterbourgon/ff/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/v3"
"github.com/peterbourgon/ff"
)

// 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/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) {
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/v3"
"github.com/peterbourgon/ff"
"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/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) {
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/v3
module github.com/peterbourgon/ff

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/v3"
"github.com/peterbourgon/ff/v3/fftest"
"github.com/peterbourgon/ff"
"github.com/peterbourgon/ff/fftest"
)

func TestJSONParser(t *testing.T) {
Expand Down
7 changes: 3 additions & 4 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/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) {
Expand Down Expand Up @@ -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)
}

}

0 comments on commit 0aaa7b5

Please sign in to comment.