Skip to content

Commit

Permalink
Merge pull request #1 from vseinstrumentiru/MS_PLATFORM-127
Browse files Browse the repository at this point in the history
feat: version flag added
  • Loading branch information
brain545 authored Feb 14, 2022
2 parents d3de1fd + fcd96dd commit b8f57a3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ module github.com/vseinstrumentiru/protoc-gen-go-kafka

go 1.17

require github.com/pkg/errors v0.9.1

require (
github.com/stretchr/testify v1.7.0
google.golang.org/protobuf v1.26.0
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
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/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
14 changes: 13 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,21 @@ type gen struct {
PathFile string
}

const defaultSuffix = "Export"
const (
defaultSuffix = "Export"
version = "v1.1.1"
)

func main() {
versionFlag := flag.Bool("version", false, "print version and exit")
flag.Parse()

if *versionFlag {
fmt.Println(version)

return
}

var flags flag.FlagSet
suffix := flags.String("suffix", defaultSuffix, "")
protoc := protogen.Options{
Expand Down

0 comments on commit b8f57a3

Please sign in to comment.