Skip to content

Commit 421da67

Browse files
authored
Merge pull request #3812 from dmaluka/update-manpage
Update man page + change `[FILE]:LINE:COL` to `FILE[:LINE:COL]` in `micro -help`
2 parents 86a9fac + c7d65d1 commit 421da67

File tree

2 files changed

+57
-46
lines changed

2 files changed

+57
-46
lines changed

‎assets/packaging/micro.1‎

Lines changed: 48 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,98 @@
1-
.TH micro 1 "2020-02-10"
1+
.TH micro 1 "2025-08-16"
22
.SH NAME
33
micro \- A modern and intuitive terminal-based text editor
44
.SH SYNOPSIS
55
.B micro
6-
.RB [OPTIONS]
7-
[FILE]\&...
8-
6+
.RI [ OPTION ]...\&
7+
.RI [ FILE ]...\&
8+
.RI [+ LINE [: COL ]]
9+
.br
10+
.B micro
11+
.RI [ OPTION ]...\&
12+
.RI [ FILE [: LINE [: COL ]]]...\&
13+
\& (only if the `parsecursor` option is enabled)
914
.SH DESCRIPTION
10-
1115
Micro is a terminal-based text editor that aims to be easy to use and intuitive, while also taking advantage of the full capabilities
1216
of modern terminals. It comes as one single, batteries-included, static binary with no dependencies.
1317

1418
As the name indicates, micro aims to be somewhat of a successor to the nano editor by being easy to install and use in a pinch, but micro also aims to be
1519
enjoyable to use full time, whether you work in the terminal because you prefer it (like me), or because you need to (over ssh).
1620

1721
Use Ctrl-q to quit, Ctrl-s to save, and Ctrl-g to open the in-editor help menu.
18-
1922
.SH OPTIONS
2023
.PP
21-
\-clean
24+
.B \-clean
2225
.RS 4
23-
Cleans the configuration directory
26+
Clean the configuration directory and exit
2427
.RE
25-
2628
.PP
27-
\-config-dir dir
29+
.B \-config-dir
30+
.I dir
2831
.RS 4
2932
Specify a custom location for the configuration directory
3033
.RE
31-
3234
.PP
33-
[FILE]:LINE:COL
35+
.IR FILE : LINE [: COL ]
36+
(only if the `parsecursor` option is enabled)
37+
.br
38+
.IR FILE \ + LINE [: COL ]
3439
.RS 4
3540
Specify a line and column to start the cursor at when opening a buffer
3641
.RE
37-
3842
.PP
39-
\-options
43+
.B \-options
4044
.RS 4
41-
Show all option help
45+
Show all options help and exit
4246
.RE
43-
4447
.PP
45-
\-debug
48+
.B \-debug
4649
.RS 4
4750
Enable debug mode (enables logging to ./log.txt)
4851
.RE
49-
5052
.PP
51-
\-version
53+
.B \-profile
54+
.RS 4
55+
Enable CPU profiling (writes profile info to ./micro.prof so it can be analyzed later with "go tool pprof micro.prof")
56+
.RE
57+
.PP
58+
.B \-version
5259
.RS 4
53-
Show the version number and information
60+
Show the version number and information and exit
5461
.RE
5562

5663
Micro's plugins can be managed at the command line with the following commands.
5764
.RS 4
58-
5965
.PP
60-
\-plugin remove [PLUGIN]...
66+
.B \-plugin install
67+
.RI [ PLUGIN ]...
68+
.RS 4
69+
Install plugin(s)
70+
.RE
71+
.PP
72+
.B \-plugin remove
73+
.RI [ PLUGIN ]...
6174
.RS 4
6275
Remove plugin(s)
6376
.RE
64-
6577
.PP
66-
\-plugin update [PLUGIN]...
78+
.B \-plugin update
79+
.RI [ PLUGIN ]...
6780
.RS 4
6881
Update plugin(s) (if no argument is given, updates all plugins)
6982
.RE
70-
7183
.PP
72-
\-plugin search [PLUGIN]...
84+
.B \-plugin search
85+
.RI [ PLUGIN ]...
7386
.RS 4
7487
Search for a plugin
7588
.RE
76-
7789
.PP
78-
\-plugin list
90+
.B \-plugin list
7991
.RS 4
8092
List installed plugins
8193
.RE
82-
8394
.PP
84-
\-plugin available
95+
.B \-plugin available
8596
.RS 4
8697
List available plugins
8798
.RE
@@ -91,35 +102,33 @@ Micro's options can also be set via command line arguments for quick
91102
adjustments. For real configuration, please use the settings.json
92103
file (see 'help options').
93104
.RS 4
94-
95105
.PP
96-
\-option value
106+
.BI \-< option >
107+
.I value
97108
.RS 4
98-
Set `option` to `value` for this session
109+
Set `option` to `value` for this session.
110+
.br
99111
For example: `micro -syntax off file.c`
100112
.RE
101-
102-
113+
.RE
114+
.PP
115+
Use `micro -options` to see the full list of configuration options.
103116
.SH CONFIGURATION
104-
105117
Micro uses $MICRO_CONFIG_HOME as the configuration directory.
106118
If this environment variable is not set, it uses $XDG_CONFIG_HOME/micro instead.
107119
If that environment variable is not set, it uses ~/.config/micro as the configuration directory.
108120
In the documentation, we use ~/.config/micro to refer to the configuration directory
109121
(even if it may in fact be somewhere else if you have set either of the above environment variables).
110-
111122
.SH NOTICE
112123
This manpage is intended only to serve as a quick guide to the invocation of
113124
micro and is not intended to replace the full documentation included with micro
114125
which can be accessed from within micro. Micro tells you what key combination to
115126
press to get help in the lower right.
116-
117127
.SH BUGS
118128
A comprehensive list of bugs will not be listed in this manpage. See the Github
119129
page at \fBhttps://github.com/zyedidia/micro/issues\fP for a list of known bugs
120130
and to report any newly encountered bugs you may find. We strive to correct
121131
bugs as swiftly as possible.
122-
123132
.SH COPYRIGHT
124133
Copyright \(co 2020 Zachary Yedidia, et al. MIT license.
125134
See \fBhttps://github.com/zyedidia/micro\fP for details.

‎cmd/micro/micro.go‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,26 @@ var (
4646
)
4747

4848
func InitFlags() {
49+
// Note: keep this in sync with the man page in assets/packaging/micro.1
4950
flag.Usage = func() {
50-
fmt.Println("Usage: micro [OPTIONS] [FILE]...")
51+
fmt.Println("Usage: micro [OPTION]... [FILE]... [+LINE[:COL]]")
52+
fmt.Println(" micro [OPTION]... [FILE[:LINE[:COL]]]... (only if the `parsecursor` option is enabled)")
5153
fmt.Println("-clean")
52-
fmt.Println(" \tCleans the configuration directory")
54+
fmt.Println(" \tClean the configuration directory and exit")
5355
fmt.Println("-config-dir dir")
5456
fmt.Println(" \tSpecify a custom location for the configuration directory")
55-
fmt.Println("[FILE]:LINE:COL (if the `parsecursor` option is enabled)")
56-
fmt.Println("+LINE:COL")
57+
fmt.Println("FILE:LINE[:COL] (only if the `parsecursor` option is enabled)")
58+
fmt.Println("FILE +LINE[:COL]")
5759
fmt.Println(" \tSpecify a line and column to start the cursor at when opening a buffer")
5860
fmt.Println("-options")
59-
fmt.Println(" \tShow all option help")
61+
fmt.Println(" \tShow all options help and exit")
6062
fmt.Println("-debug")
6163
fmt.Println(" \tEnable debug mode (enables logging to ./log.txt)")
6264
fmt.Println("-profile")
6365
fmt.Println(" \tEnable CPU profiling (writes profile info to ./micro.prof")
6466
fmt.Println(" \tso it can be analyzed later with \"go tool pprof micro.prof\")")
6567
fmt.Println("-version")
66-
fmt.Println(" \tShow the version number and information")
68+
fmt.Println(" \tShow the version number and information and exit")
6769

6870
fmt.Print("\nMicro's plugins can be managed at the command line with the following commands.\n")
6971
fmt.Println("-plugin install [PLUGIN]...")
@@ -80,7 +82,7 @@ func InitFlags() {
8082
fmt.Println(" \tList available plugins")
8183

8284
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")
83-
fmt.Println("-option value")
85+
fmt.Println("-<option> value")
8486
fmt.Println(" \tSet `option` to `value` for this session")
8587
fmt.Println(" \tFor example: `micro -syntax off file.c`")
8688
fmt.Println("\nUse `micro -options` to see the full list of configuration options")

0 commit comments

Comments
 (0)