diff options
author | Ayke van Laethem <[email protected]> | 2024-02-22 20:39:56 +0100 |
---|---|---|
committer | Ron Evans <[email protected]> | 2024-02-23 08:37:26 +0100 |
commit | ca9211b582e9295c167e5ec5cdef2265823861ca (patch) | |
tree | 4a79cb966c8d96a527c744e6dab7e46af31e9e49 | |
parent | cb7d470ba45af260e3ec9a0ebf7b066be5a7b311 (diff) | |
download | tinygo-ca9211b582e9295c167e5ec5cdef2265823861ca.tar.gz tinygo-ca9211b582e9295c167e5ec5cdef2265823861ca.zip |
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.
-rw-r--r-- | main.go | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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() |