main: change monitor -info
to ports
I believe this provides a better UX.
Этот коммит содержится в:
родитель
5baee9a8ee
коммит
cb7d470ba4
1 изменённых файлов: 10 добавлений и 12 удалений
22
main.go
22
main.go
|
@ -1225,6 +1225,7 @@ func usage(command string) {
|
||||||
fmt.Fprintln(os.Stderr, " gdb: run/flash and immediately enter GDB")
|
fmt.Fprintln(os.Stderr, " gdb: run/flash and immediately enter GDB")
|
||||||
fmt.Fprintln(os.Stderr, " lldb: run/flash and immediately enter LLDB")
|
fmt.Fprintln(os.Stderr, " lldb: run/flash and immediately enter LLDB")
|
||||||
fmt.Fprintln(os.Stderr, " monitor: open communication port")
|
fmt.Fprintln(os.Stderr, " monitor: open communication port")
|
||||||
|
fmt.Fprintln(os.Stderr, " ports: list available serial ports")
|
||||||
fmt.Fprintln(os.Stderr, " env: list environment variables used during build")
|
fmt.Fprintln(os.Stderr, " env: list environment variables used during build")
|
||||||
fmt.Fprintln(os.Stderr, " list: run go list using the TinyGo root")
|
fmt.Fprintln(os.Stderr, " list: run go list using the TinyGo root")
|
||||||
fmt.Fprintln(os.Stderr, " clean: empty cache directory ("+goenv.Get("GOCACHE")+")")
|
fmt.Fprintln(os.Stderr, " clean: empty cache directory ("+goenv.Get("GOCACHE")+")")
|
||||||
|
@ -1437,7 +1438,6 @@ func main() {
|
||||||
llvmFeatures := flag.String("llvm-features", "", "comma separated LLVM features to enable")
|
llvmFeatures := flag.String("llvm-features", "", "comma separated LLVM features to enable")
|
||||||
cpuprofile := flag.String("cpuprofile", "", "cpuprofile output")
|
cpuprofile := flag.String("cpuprofile", "", "cpuprofile output")
|
||||||
monitor := flag.Bool("monitor", false, "enable serial monitor")
|
monitor := flag.Bool("monitor", false, "enable serial monitor")
|
||||||
info := flag.Bool("info", false, "print information")
|
|
||||||
baudrate := flag.Int("baudrate", 115200, "baudrate of serial monitor")
|
baudrate := flag.Int("baudrate", 115200, "baudrate of serial monitor")
|
||||||
|
|
||||||
// Internal flags, that are only intended for TinyGo development.
|
// Internal flags, that are only intended for TinyGo development.
|
||||||
|
@ -1733,17 +1733,15 @@ func main() {
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
case "monitor":
|
case "monitor":
|
||||||
if *info {
|
config, err := builder.NewConfig(options)
|
||||||
serialPortInfo, err := ListSerialPorts()
|
handleCompilerError(err)
|
||||||
handleCompilerError(err)
|
err = Monitor("", *port, config)
|
||||||
for _, s := range serialPortInfo {
|
handleCompilerError(err)
|
||||||
fmt.Printf("%s %4s %4s %s\n", s.Name, s.VID, s.PID, s.Target)
|
case "ports":
|
||||||
}
|
serialPortInfo, err := ListSerialPorts()
|
||||||
} else {
|
handleCompilerError(err)
|
||||||
config, err := builder.NewConfig(options)
|
for _, s := range serialPortInfo {
|
||||||
handleCompilerError(err)
|
fmt.Printf("%s %4s %4s %s\n", s.Name, s.VID, s.PID, s.Target)
|
||||||
err = Monitor("", *port, config)
|
|
||||||
handleCompilerError(err)
|
|
||||||
}
|
}
|
||||||
case "targets":
|
case "targets":
|
||||||
specs, err := compileopts.GetTargetSpecs()
|
specs, err := compileopts.GetTargetSpecs()
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче