@@ -1225,6 +1225,7 @@ func usage(command string) {
1225
1225
fmt .Fprintln (os .Stderr , " gdb: run/flash and immediately enter GDB" )
1226
1226
fmt .Fprintln (os .Stderr , " lldb: run/flash and immediately enter LLDB" )
1227
1227
fmt .Fprintln (os .Stderr , " monitor: open communication port" )
1228
+ fmt .Fprintln (os .Stderr , " ports: list available serial ports" )
1228
1229
fmt .Fprintln (os .Stderr , " env: list environment variables used during build" )
1229
1230
fmt .Fprintln (os .Stderr , " list: run go list using the TinyGo root" )
1230
1231
fmt .Fprintln (os .Stderr , " clean: empty cache directory (" + goenv .Get ("GOCACHE" )+ ")" )
@@ -1437,7 +1438,6 @@ func main() {
1437
1438
llvmFeatures := flag .String ("llvm-features" , "" , "comma separated LLVM features to enable" )
1438
1439
cpuprofile := flag .String ("cpuprofile" , "" , "cpuprofile output" )
1439
1440
monitor := flag .Bool ("monitor" , false , "enable serial monitor" )
1440
- info := flag .Bool ("info" , false , "print information" )
1441
1441
baudrate := flag .Int ("baudrate" , 115200 , "baudrate of serial monitor" )
1442
1442
1443
1443
// Internal flags, that are only intended for TinyGo development.
@@ -1733,17 +1733,15 @@ func main() {
1733
1733
os .Exit (1 )
1734
1734
}
1735
1735
case "monitor" :
1736
- if * info {
1737
- serialPortInfo , err := ListSerialPorts ()
1738
- handleCompilerError (err )
1739
- for _ , s := range serialPortInfo {
1740
- fmt .Printf ("%s %4s %4s %s\n " , s .Name , s .VID , s .PID , s .Target )
1741
- }
1742
- } else {
1743
- config , err := builder .NewConfig (options )
1744
- handleCompilerError (err )
1745
- err = Monitor ("" , * port , config )
1746
- handleCompilerError (err )
1736
+ config , err := builder .NewConfig (options )
1737
+ handleCompilerError (err )
1738
+ err = Monitor ("" , * port , config )
1739
+ handleCompilerError (err )
1740
+ case "ports" :
1741
+ serialPortInfo , err := ListSerialPorts ()
1742
+ handleCompilerError (err )
1743
+ for _ , s := range serialPortInfo {
1744
+ fmt .Printf ("%s %4s %4s %s\n " , s .Name , s .VID , s .PID , s .Target )
1747
1745
}
1748
1746
case "targets" :
1749
1747
specs , err := compileopts .GetTargetSpecs ()
0 commit comments