Skip to content

Commit

Permalink
cmd/gop: gop c2go
Browse files Browse the repository at this point in the history
  • Loading branch information
xushiwei committed May 21, 2022
1 parent 8dbb7d9 commit c7c2290
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 6 deletions.
12 changes: 7 additions & 5 deletions cmd/gop/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"strings"

"github.com/goplus/gop/cmd/internal/bug"
"github.com/goplus/gop/cmd/internal/c2go"
"github.com/goplus/gop/cmd/internal/gopget"
"github.com/qiniu/x/log"

Expand All @@ -49,18 +50,19 @@ func init() {
flag.Usage = mainUsage
base.Gop.Commands = []*base.Command{
run.Cmd,
gengo.Cmd,
install.Cmd,
build.Cmd,
mod.Cmd,
test.Cmd,
gopfmt.Cmd,
gopget.Cmd,
bug.Cmd,
gengo.Cmd,
mod.Cmd,
clean.Cmd,
env.Cmd,
test.Cmd,
// list.Cmd,
// deps.Cmd,
env.Cmd,
c2go.Cmd,
bug.Cmd,
version.Cmd,
}
}
Expand Down
3 changes: 2 additions & 1 deletion cmd/internal/bug/bug.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ import (
"fmt"
"io"
"log"
urlpkg "net/url"
"os"
"os/exec"
"path/filepath"
"regexp"
"runtime"
"time"

urlpkg "net/url"

"github.com/goplus/gop/cmd/internal/base"
"github.com/goplus/gop/env"
)
Expand Down
26 changes: 26 additions & 0 deletions cmd/internal/c2go/c2go.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package c2go

import (
"os"

"github.com/goplus/gop/cmd/internal/base"

c2go "github.com/goplus/c2go/cmd/c2go/impl"
)

// gop c2go
var Cmd = &base.Command{
UsageLine: "gop " + c2go.ShortUsage,
Short: "Run c2go (convert C to Go) tools",
}

func init() {
Cmd.Flag.Usage = func() {
Cmd.Usage(os.Stderr)
}
Cmd.Run = runCmd
}

func runCmd(cmd *base.Command, args []string) {
c2go.Main(&Cmd.Flag, args)
}
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module github.com/goplus/gop
go 1.16

require (
github.com/goplus/c2go v0.7.1
github.com/goplus/gox v1.11.7
github.com/goplus/mod v0.9.3
github.com/qiniu/x v1.11.5
Expand Down
17 changes: 17 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
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/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/goplus/c2go v0.7.1 h1:F/ZofTnR9hONoIpTHXhNVNX0m1UBD/jDp5xRbROKq+s=
github.com/goplus/c2go v0.7.1/go.mod h1:1om0h0m9wOzUqgxtLvaPOd2B1raurJmZ3ghGP576zZA=
github.com/goplus/gox v1.11.7 h1:YbTrET69TPdZFwT7ESKeDmwq7wpXRb3DUZ474bCC9Og=
github.com/goplus/gox v1.11.7/go.mod h1:gu7fuQF8RmWPZUjd+tEJGuV3m/vOEv0bHrct0x/KatM=
github.com/goplus/mod v0.9.3 h1:kXN2kavdUacqy39Lh/pIdT0zvBTKevb4u96ZbapPbcg=
github.com/goplus/mod v0.9.3/go.mod h1:NHU13OjeNV3ez1f+R9FLJIlIun0KNSuZb0jnmP3N3o8=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
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/qiniu/x v1.11.5 h1:TYr5cl4g2yoHAZeDK4MTjKF6CMoG+IHlCDvvM5qym6U=
github.com/qiniu/x v1.11.5/go.mod h1:03Ni9tj+N2h2aKnAz+6N0Xfl8FwMEDRC2PAlxekASDs=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
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=
Expand Down

0 comments on commit c7c2290

Please sign in to comment.