mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-05 03:27:48 +00:00
main: make ports subcommand more verbose
By listing column headers and printing a message when no ports are found, it should be a bit easier to use.
This commit is contained in:
committed by
Ron Evans
parent
cb7d470ba4
commit
ca9211b582
@@ -1740,8 +1740,12 @@ func main() {
|
||||
case "ports":
|
||||
serialPortInfo, err := ListSerialPorts()
|
||||
handleCompilerError(err)
|
||||
if len(serialPortInfo) == 0 {
|
||||
fmt.Println("No serial ports found.")
|
||||
}
|
||||
fmt.Printf("%-20s %-9s %s\n", "Port", "ID", "Boards")
|
||||
for _, s := range serialPortInfo {
|
||||
fmt.Printf("%s %4s %4s %s\n", s.Name, s.VID, s.PID, s.Target)
|
||||
fmt.Printf("%-20s %4s:%4s %s\n", s.Name, s.VID, s.PID, s.Target)
|
||||
}
|
||||
case "targets":
|
||||
specs, err := compileopts.GetTargetSpecs()
|
||||
|
||||
Reference in New Issue
Block a user