Improve micro -help output

This commit is contained in:
Dmytro Maluka
2025-07-21 01:07:39 +02:00
parent 86a9fac7ef
commit f735ff04b4

View File

@@ -47,23 +47,24 @@ var (
func InitFlags() { func InitFlags() {
flag.Usage = func() { flag.Usage = func() {
fmt.Println("Usage: micro [OPTIONS] [FILE]...") fmt.Println("Usage: micro [OPTION]... [FILE]... [+LINE[:COL]]")
fmt.Println(" micro [OPTION]... [FILE[:LINE[:COL]]]... (only if the `parsecursor` option is enabled)")
fmt.Println("-clean") fmt.Println("-clean")
fmt.Println(" \tCleans the configuration directory") fmt.Println(" \tClean the configuration directory and exit")
fmt.Println("-config-dir dir") fmt.Println("-config-dir dir")
fmt.Println(" \tSpecify a custom location for the configuration directory") fmt.Println(" \tSpecify a custom location for the configuration directory")
fmt.Println("[FILE]:LINE:COL (if the `parsecursor` option is enabled)") fmt.Println("FILE:LINE[:COL] (only if the `parsecursor` option is enabled)")
fmt.Println("+LINE:COL") fmt.Println("FILE +LINE[:COL]")
fmt.Println(" \tSpecify a line and column to start the cursor at when opening a buffer") fmt.Println(" \tSpecify a line and column to start the cursor at when opening a buffer")
fmt.Println("-options") fmt.Println("-options")
fmt.Println(" \tShow all option help") fmt.Println(" \tShow all options help and exit")
fmt.Println("-debug") fmt.Println("-debug")
fmt.Println(" \tEnable debug mode (enables logging to ./log.txt)") fmt.Println(" \tEnable debug mode (enables logging to ./log.txt)")
fmt.Println("-profile") fmt.Println("-profile")
fmt.Println(" \tEnable CPU profiling (writes profile info to ./micro.prof") fmt.Println(" \tEnable CPU profiling (writes profile info to ./micro.prof")
fmt.Println(" \tso it can be analyzed later with \"go tool pprof micro.prof\")") fmt.Println(" \tso it can be analyzed later with \"go tool pprof micro.prof\")")
fmt.Println("-version") fmt.Println("-version")
fmt.Println(" \tShow the version number and information") fmt.Println(" \tShow the version number and information and exit")
fmt.Print("\nMicro's plugins can be managed at the command line with the following commands.\n") fmt.Print("\nMicro's plugins can be managed at the command line with the following commands.\n")
fmt.Println("-plugin install [PLUGIN]...") fmt.Println("-plugin install [PLUGIN]...")
@@ -80,7 +81,7 @@ func InitFlags() {
fmt.Println(" \tList available plugins") fmt.Println(" \tList available plugins")
fmt.Print("\nMicro's options can also be set via command line arguments for quick\nadjustments. For real configuration, please use the settings.json\nfile (see 'help options').\n\n") fmt.Print("\nMicro's options can also be set via command line arguments for quick\nadjustments. For real configuration, please use the settings.json\nfile (see 'help options').\n\n")
fmt.Println("-option value") fmt.Println("-<option> value")
fmt.Println(" \tSet `option` to `value` for this session") fmt.Println(" \tSet `option` to `value` for this session")
fmt.Println(" \tFor example: `micro -syntax off file.c`") fmt.Println(" \tFor example: `micro -syntax off file.c`")
fmt.Println("\nUse `micro -options` to see the full list of configuration options") fmt.Println("\nUse `micro -options` to see the full list of configuration options")