diff --git a/README.md b/README.md index 3221d8c..f255b6d 100644 --- a/README.md +++ b/README.md @@ -64,8 +64,8 @@ Add bash completion capabilities to any Go program. See [./example/command](./ex ```go import ( "flag" - "github.com/posener/complete" - "github.com/posener/complete/predict" + "github.com/posener/complete/v2" + "github.com/posener/complete/v2/predict" ) var ( @@ -99,7 +99,7 @@ To use this feature, simply call `complete.CommandLine` before `flag.Parse`. (Se ```diff import ( "flag" - + "github.com/posener/complete" + + "github.com/posener/complete/v2" ) var ( // Define flags here... @@ -121,8 +121,8 @@ flag with values, it is possible to use the `github.com/posener/complete/compfla ```diff import ( "flag" - + "github.com/posener/complete" - + "github.com/posener/complete/compflag" + + "github.com/posener/complete/v2" + + "github.com/posener/complete/v2/compflag" ) var ( // Define flags here... diff --git a/compflag/compflag.go b/compflag/compflag.go index cfb4440..b1e31b9 100644 --- a/compflag/compflag.go +++ b/compflag/compflag.go @@ -2,7 +2,7 @@ // // Usage // -// import "github.com/posener/complete/compflag" +// import "github.com/posener/complete/v2/compflag" // // var ( // // Define flags... @@ -18,7 +18,7 @@ // // import ( // "flag" -// "github.com/posener/complete/compflag" +// "github.com/posener/complete/v2/compflag" // ) // // var ( @@ -41,7 +41,7 @@ import ( "strconv" "strings" - "github.com/posener/complete" + "github.com/posener/complete/v2" ) // Flag options. diff --git a/compflag/compflag_test.go b/compflag/compflag_test.go index 1e8dea5..037ef07 100644 --- a/compflag/compflag_test.go +++ b/compflag/compflag_test.go @@ -4,7 +4,7 @@ import ( "flag" "testing" - "github.com/posener/complete" + "github.com/posener/complete/v2" "github.com/stretchr/testify/assert" ) diff --git a/complete.go b/complete.go index 7e4a3d5..f64abd8 100644 --- a/complete.go +++ b/complete.go @@ -7,9 +7,9 @@ import ( "strconv" "strings" - "github.com/posener/complete/internal/arg" - "github.com/posener/complete/internal/install" - "github.com/posener/complete/internal/tokener" + "github.com/posener/complete/v2/internal/arg" + "github.com/posener/complete/v2/internal/install" + "github.com/posener/complete/v2/internal/tokener" ) // Completer is an interface that a command line should implement in order to get bash completion. diff --git a/complete_test.go b/complete_test.go index 4752230..36e6c5b 100644 --- a/complete_test.go +++ b/complete_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/posener/complete/internal/arg" + "github.com/posener/complete/v2/internal/arg" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/doc.go b/doc.go index 470dcf5..6e75247 100644 --- a/doc.go +++ b/doc.go @@ -54,8 +54,8 @@ Add bash completion capabilities to any Go program. See ./example/command. import ( "flag" - "github.com/posener/complete" - "github.com/posener/complete/predict" + "github.com/posener/complete/v2" + "github.com/posener/complete/v2/predict" ) var ( @@ -87,7 +87,7 @@ To use this feature, simply call `complete.CommandLine` before `flag.Parse`. (Se import ( "flag" - + "github.com/posener/complete" + + "github.com/posener/complete/v2" ) var ( // Define flags here... @@ -107,8 +107,8 @@ flag with values, it is possible to use the `github.com/posener/complete/compfla import ( "flag" - + "github.com/posener/complete" - + "github.com/posener/complete/compflag" + + "github.com/posener/complete/v2" + + "github.com/posener/complete/v2/compflag" ) var ( // Define flags here... diff --git a/example/command/main.go b/example/command/main.go index 0b073d9..c8c1414 100644 --- a/example/command/main.go +++ b/example/command/main.go @@ -7,8 +7,8 @@ import ( "fmt" "os" - "github.com/posener/complete" - "github.com/posener/complete/predict" + "github.com/posener/complete/v2" + "github.com/posener/complete/v2/predict" ) var ( diff --git a/example/compflag/main.go b/example/compflag/main.go index 84d82d6..897dbb4 100644 --- a/example/compflag/main.go +++ b/example/compflag/main.go @@ -6,7 +6,7 @@ import ( "fmt" "os" - "github.com/posener/complete/compflag" + "github.com/posener/complete/v2/compflag" ) var ( diff --git a/example/stdlib/main.go b/example/stdlib/main.go index 03c6391..5beee51 100644 --- a/example/stdlib/main.go +++ b/example/stdlib/main.go @@ -7,7 +7,7 @@ import ( "fmt" "os" - "github.com/posener/complete" + "github.com/posener/complete/v2" ) var ( diff --git a/go.mod b/go.mod index 6d82a98..914444c 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/posener/complete +module github.com/posener/complete/v2 require ( github.com/hashicorp/go-multierror v1.0.0 diff --git a/go.sum b/go.sum index accaa27..907c6ce 100644 --- a/go.sum +++ b/go.sum @@ -6,6 +6,8 @@ github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uP github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.2.2 h1:xu2vuFugxm4IfAymbmmVrnEVy29eGUDn8I7HheRseHg= +github.com/posener/complete v1.2.2/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= diff --git a/gocomplete/complete.go b/gocomplete/complete.go index 3dbb4c9..2cf4227 100644 --- a/gocomplete/complete.go +++ b/gocomplete/complete.go @@ -2,8 +2,8 @@ package main import ( - "github.com/posener/complete" - "github.com/posener/complete/predict" + "github.com/posener/complete/v2" + "github.com/posener/complete/v2/predict" ) var ( diff --git a/gocomplete/pkgs.go b/gocomplete/pkgs.go index bfdfa04..252bb26 100644 --- a/gocomplete/pkgs.go +++ b/gocomplete/pkgs.go @@ -9,7 +9,7 @@ import ( "path/filepath" "strings" - "github.com/posener/complete/predict" + "github.com/posener/complete/v2/predict" ) // predictPackages completes packages in the directory pointed by a.Last diff --git a/gocomplete/tests.go b/gocomplete/tests.go index fc3a3ad..001fe0a 100644 --- a/gocomplete/tests.go +++ b/gocomplete/tests.go @@ -6,7 +6,7 @@ import ( "regexp" "strings" - "github.com/posener/complete" + "github.com/posener/complete/v2" ) var ( diff --git a/gocomplete/tests_test.go b/gocomplete/tests_test.go index b09ca6f..b5f96dc 100644 --- a/gocomplete/tests_test.go +++ b/gocomplete/tests_test.go @@ -5,7 +5,7 @@ import ( "sort" "testing" - "github.com/posener/complete" + "github.com/posener/complete/v2" ) func TestPredictions(t *testing.T) { diff --git a/internal/arg/arg.go b/internal/arg/arg.go index 0577d74..f28e4b3 100644 --- a/internal/arg/arg.go +++ b/internal/arg/arg.go @@ -2,7 +2,7 @@ package arg import "strings" -import "github.com/posener/complete/internal/tokener" +import "github.com/posener/complete/v2/internal/tokener" // Arg is typed a command line argument. type Arg struct { diff --git a/predict/predict.go b/predict/predict.go index f4d5bb7..05fbef9 100644 --- a/predict/predict.go +++ b/predict/predict.go @@ -1,7 +1,7 @@ // Package predict provides helper functions for completion predictors. package predict -import "github.com/posener/complete" +import "github.com/posener/complete/v2" // Set predicts a set of predefined values. type Set []string diff --git a/predict/predict_test.go b/predict/predict_test.go index af3bf69..04c210a 100644 --- a/predict/predict_test.go +++ b/predict/predict_test.go @@ -3,7 +3,7 @@ package predict import ( "testing" - "github.com/posener/complete" + "github.com/posener/complete/v2" "github.com/stretchr/testify/assert" ) diff --git a/testing.go b/testing.go index 3336aa6..3195660 100644 --- a/testing.go +++ b/testing.go @@ -4,7 +4,7 @@ import ( "sort" "testing" - "github.com/posener/complete/internal/arg" + "github.com/posener/complete/v2/internal/arg" ) // Test is a testing helper function for testing bash completion of a given completer.