diff --git a/example/cmd/charmer.go b/example/cmd/charmer.go index 5234208..c0c567d 100644 --- a/example/cmd/charmer.go +++ b/example/cmd/charmer.go @@ -1,8 +1,8 @@ package main import ( - "github.com/matzefriedrich/cobra-extensions-example/commands" - "github.com/matzefriedrich/cobra-extensions/v0/pkg/charmer" + "github.com/matzefriedrich/cobra-extensions/example/commands" + "github.com/matzefriedrich/cobra-extensions/pkg/charmer" "log" ) diff --git a/example/cmd/main.go b/example/cmd/main.go index 1b34b38..cd63714 100644 --- a/example/cmd/main.go +++ b/example/cmd/main.go @@ -1,9 +1,9 @@ package main import ( + "github.com/matzefriedrich/cobra-extensions/example/commands" "os" - "github.com/matzefriedrich/cobra-extensions-example/commands" "github.com/spf13/cobra" ) diff --git a/example/commands/crypto_commands.go b/example/commands/crypto_commands.go index 19dc5cc..d5f41af 100644 --- a/example/commands/crypto_commands.go +++ b/example/commands/crypto_commands.go @@ -1,8 +1,8 @@ package commands import ( - "github.com/matzefriedrich/cobra-extensions/v0/pkg" - "github.com/matzefriedrich/cobra-extensions/v0/pkg/abstractions" + "github.com/matzefriedrich/cobra-extensions/pkg" + "github.com/matzefriedrich/cobra-extensions/pkg/abstractions" "github.com/spf13/cobra" ) diff --git a/example/commands/decrypt.go b/example/commands/decrypt.go index d0b21b8..7da7d7f 100644 --- a/example/commands/decrypt.go +++ b/example/commands/decrypt.go @@ -1,12 +1,12 @@ package commands import ( + "github.com/matzefriedrich/cobra-extensions/pkg" + "github.com/matzefriedrich/cobra-extensions/pkg/abstractions" "io" "os" "github.com/ProtonMail/gopenpgp/v2/crypto" - "github.com/matzefriedrich/cobra-extensions/v0/pkg" - "github.com/matzefriedrich/cobra-extensions/v0/pkg/abstractions" "github.com/spf13/cobra" ) diff --git a/example/commands/encrypt.go b/example/commands/encrypt.go index 8ac932a..2702b6c 100644 --- a/example/commands/encrypt.go +++ b/example/commands/encrypt.go @@ -1,11 +1,11 @@ package commands import ( + "github.com/matzefriedrich/cobra-extensions/pkg" + "github.com/matzefriedrich/cobra-extensions/pkg/abstractions" "os" "github.com/ProtonMail/gopenpgp/v2/crypto" - "github.com/matzefriedrich/cobra-extensions/v0/pkg" - "github.com/matzefriedrich/cobra-extensions/v0/pkg/abstractions" "github.com/spf13/cobra" ) diff --git a/example/commands/hello.go b/example/commands/hello.go index c54a757..aa0b4b6 100644 --- a/example/commands/hello.go +++ b/example/commands/hello.go @@ -2,10 +2,9 @@ package commands import ( "fmt" + "github.com/matzefriedrich/cobra-extensions/pkg" + "github.com/matzefriedrich/cobra-extensions/pkg/abstractions" - "github.com/matzefriedrich/cobra-extensions/v0/pkg/abstractions" - - "github.com/matzefriedrich/cobra-extensions/v0/pkg" "github.com/spf13/cobra" ) diff --git a/example/go.mod b/example/go.mod deleted file mode 100644 index ead6039..0000000 --- a/example/go.mod +++ /dev/null @@ -1,21 +0,0 @@ -module github.com/matzefriedrich/cobra-extensions-example - -go 1.21.1 - -require ( - github.com/ProtonMail/gopenpgp/v2 v2.7.5 - github.com/spf13/cobra v1.8.0 -) - -require ( - github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95 // indirect - github.com/ProtonMail/go-mime v0.0.0-20230322103455-7d82a3887f2f // indirect - github.com/cloudflare/circl v1.3.3 // indirect - github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/pkg/errors v0.9.1 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/stretchr/testify v1.9.0 // indirect - golang.org/x/crypto v0.7.0 // indirect - golang.org/x/sys v0.6.0 // indirect - golang.org/x/text v0.8.0 // indirect -) diff --git a/go.mod b/go.mod index effa3d7..e837eb3 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,25 @@ module github.com/matzefriedrich/cobra-extensions -go 1.21.1 +go 1.21 + +require ( + github.com/ProtonMail/gopenpgp/v2 v2.7.5 + github.com/google/uuid v1.6.0 + github.com/spf13/cobra v1.8.0 + github.com/stretchr/testify v1.9.0 +) + +require ( + github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95 // indirect + github.com/ProtonMail/go-mime v0.0.0-20230322103455-7d82a3887f2f // indirect + github.com/cloudflare/circl v1.3.3 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + golang.org/x/crypto v0.7.0 // indirect + golang.org/x/sys v0.6.0 // indirect + golang.org/x/text v0.8.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/example/go.sum b/go.sum similarity index 95% rename from example/go.sum rename to go.sum index 8397864..291bb7b 100644 --- a/example/go.sum +++ b/go.sum @@ -11,6 +11,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -25,6 +27,7 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= @@ -69,6 +72,7 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/v0/internal/stack.go b/internal/stack.go similarity index 100% rename from v0/internal/stack.go rename to internal/stack.go diff --git a/v0/internal/use.go b/internal/use.go similarity index 100% rename from v0/internal/use.go rename to internal/use.go diff --git a/v0/internal/use_test.go b/internal/use_test.go similarity index 100% rename from v0/internal/use_test.go rename to internal/use_test.go diff --git a/v0/pkg/abstractions/base_command.go b/pkg/abstractions/base_command.go similarity index 100% rename from v0/pkg/abstractions/base_command.go rename to pkg/abstractions/base_command.go diff --git a/v0/pkg/abstractions/command_args.go b/pkg/abstractions/command_args.go similarity index 100% rename from v0/pkg/abstractions/command_args.go rename to pkg/abstractions/command_args.go diff --git a/v0/pkg/abstractions/command_name.go b/pkg/abstractions/command_name.go similarity index 100% rename from v0/pkg/abstractions/command_name.go rename to pkg/abstractions/command_name.go diff --git a/v0/pkg/charmer/command_line_application.go b/pkg/charmer/command_line_application.go similarity index 100% rename from v0/pkg/charmer/command_line_application.go rename to pkg/charmer/command_line_application.go diff --git a/v0/pkg/charmer/command_setup.go b/pkg/charmer/command_setup.go similarity index 100% rename from v0/pkg/charmer/command_setup.go rename to pkg/charmer/command_setup.go diff --git a/v0/pkg/reflection/argument_descriptor.go b/pkg/reflection/argument_descriptor.go similarity index 100% rename from v0/pkg/reflection/argument_descriptor.go rename to pkg/reflection/argument_descriptor.go diff --git a/v0/pkg/reflection/command_descriptor.go b/pkg/reflection/command_descriptor.go similarity index 100% rename from v0/pkg/reflection/command_descriptor.go rename to pkg/reflection/command_descriptor.go diff --git a/v0/pkg/reflection/flag_descriptor.go b/pkg/reflection/flag_descriptor.go similarity index 100% rename from v0/pkg/reflection/flag_descriptor.go rename to pkg/reflection/flag_descriptor.go diff --git a/v0/pkg/reflection/reflection.go b/pkg/reflection/reflection.go similarity index 95% rename from v0/pkg/reflection/reflection.go rename to pkg/reflection/reflection.go index bc1358e..1b522e1 100644 --- a/v0/pkg/reflection/reflection.go +++ b/pkg/reflection/reflection.go @@ -1,10 +1,9 @@ package reflection import ( + "github.com/matzefriedrich/cobra-extensions/internal" + "github.com/matzefriedrich/cobra-extensions/pkg/abstractions" "reflect" - - "github.com/matzefriedrich/cobra-extensions/v0/internal" - "github.com/matzefriedrich/cobra-extensions/v0/pkg/abstractions" ) type commandReflector[T any] struct { diff --git a/v0/pkg/reflection/reflection_helpers.go b/pkg/reflection/reflection_helpers.go similarity index 100% rename from v0/pkg/reflection/reflection_helpers.go rename to pkg/reflection/reflection_helpers.go diff --git a/v0/pkg/reflection/reflection_helpers_test.go b/pkg/reflection/reflection_helpers_test.go similarity index 100% rename from v0/pkg/reflection/reflection_helpers_test.go rename to pkg/reflection/reflection_helpers_test.go diff --git a/v0/pkg/reflection/types.go b/pkg/reflection/types.go similarity index 100% rename from v0/pkg/reflection/types.go rename to pkg/reflection/types.go diff --git a/v0/pkg/typed_command.go b/pkg/typed_command.go similarity index 94% rename from v0/pkg/typed_command.go rename to pkg/typed_command.go index 09146b6..fb94365 100644 --- a/v0/pkg/typed_command.go +++ b/pkg/typed_command.go @@ -2,8 +2,8 @@ package pkg import ( "context" + "github.com/matzefriedrich/cobra-extensions/pkg/reflection" - "github.com/matzefriedrich/cobra-extensions/v0/pkg/reflection" "github.com/spf13/cobra" ) diff --git a/v0/pkg/typed_command_test.go b/pkg/typed_command_test.go similarity index 97% rename from v0/pkg/typed_command_test.go rename to pkg/typed_command_test.go index 4c3c223..4941261 100644 --- a/v0/pkg/typed_command_test.go +++ b/pkg/typed_command_test.go @@ -1,7 +1,7 @@ package pkg import ( - "github.com/matzefriedrich/cobra-extensions/v0/pkg/abstractions" + "github.com/matzefriedrich/cobra-extensions/pkg/abstractions" "github.com/spf13/cobra" "github.com/stretchr/testify/assert" "testing" diff --git a/v0/go.mod b/v0/go.mod deleted file mode 100644 index e929504..0000000 --- a/v0/go.mod +++ /dev/null @@ -1,17 +0,0 @@ -module github.com/matzefriedrich/cobra-extensions/v0 - -go 1.21 - -require ( - github.com/google/uuid v1.4.0 - github.com/spf13/cobra v1.8.0 - github.com/stretchr/testify v1.9.0 -) - -require ( - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect -) diff --git a/v0/go.sum b/v0/go.sum deleted file mode 100644 index cb3313e..0000000 --- a/v0/go.sum +++ /dev/null @@ -1,20 +0,0 @@ -github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= -github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= -github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -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/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= -github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=