mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-19 20:14:04 +00:00
main: add -test flag for tinygo list
This matches `go list` and is convenient for debugging.
This commit is contained in:
committed by
Ron Evans
parent
4c95febeee
commit
98f117fca4
@@ -947,10 +947,11 @@ func main() {
|
|||||||
wasmAbi := flag.String("wasm-abi", "", "WebAssembly ABI conventions: js (no i64 params) or generic")
|
wasmAbi := flag.String("wasm-abi", "", "WebAssembly ABI conventions: js (no i64 params) or generic")
|
||||||
llvmFeatures := flag.String("llvm-features", "", "comma separated LLVM features to enable")
|
llvmFeatures := flag.String("llvm-features", "", "comma separated LLVM features to enable")
|
||||||
|
|
||||||
var flagJSON, flagDeps *bool
|
var flagJSON, flagDeps, flagTest *bool
|
||||||
if command == "help" || command == "list" {
|
if command == "help" || command == "list" {
|
||||||
flagJSON = flag.Bool("json", false, "print data in JSON format")
|
flagJSON = flag.Bool("json", false, "print data in JSON format")
|
||||||
flagDeps = flag.Bool("deps", false, "")
|
flagDeps = flag.Bool("deps", false, "supply -deps flag to go list")
|
||||||
|
flagTest = flag.Bool("test", false, "supply -test flag to go list")
|
||||||
}
|
}
|
||||||
var outpath string
|
var outpath string
|
||||||
if command == "help" || command == "build" || command == "build-library" || command == "test" {
|
if command == "help" || command == "build" || command == "build-library" || command == "test" {
|
||||||
@@ -1200,6 +1201,9 @@ func main() {
|
|||||||
if *flagDeps {
|
if *flagDeps {
|
||||||
extraArgs = append(extraArgs, "-deps")
|
extraArgs = append(extraArgs, "-deps")
|
||||||
}
|
}
|
||||||
|
if *flagTest {
|
||||||
|
extraArgs = append(extraArgs, "-test")
|
||||||
|
}
|
||||||
cmd, err := loader.List(config, extraArgs, flag.Args())
|
cmd, err := loader.List(config, extraArgs, flag.Args())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintln(os.Stderr, "failed to run `go list`:", err)
|
fmt.Fprintln(os.Stderr, "failed to run `go list`:", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user