add select-path to -help (#749)

This commit is contained in:
Christian Zangl 2022-02-04 21:32:34 +01:00 committed by GitHub
parent a4842e19d4
commit 761aa23483
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 2 deletions

View File

@ -35,7 +35,7 @@ lf \- terminal file manager
.OP \-single .OP \-single
.OP \-version .OP \-version
.OP \-help .OP \-help
.RI [ directory ] .RI [ select-path ]
.YS .YS
.SH DESCRIPTION .SH DESCRIPTION
END END

2
lf.1
View File

@ -16,7 +16,7 @@ lf \- terminal file manager
.OP \-single .OP \-single
.OP \-version .OP \-version
.OP \-help .OP \-help
.RI [ directory ] .RI [ select-path ]
.YS .YS
.SH DESCRIPTION .SH DESCRIPTION
lf is a terminal file manager. lf is a terminal file manager.

12
main.go
View File

@ -185,6 +185,18 @@ func checkServer() {
} }
func main() { func main() {
flag.Usage = func() {
f := flag.CommandLine.Output()
fmt.Fprintln(f, "lf - Terminal file manager")
fmt.Fprintln(f, "")
fmt.Fprintf(f, "Usage: %s [options] [select-path]\n\n", os.Args[0])
fmt.Fprintln(f, " select-path")
fmt.Fprintln(f, " set the initial file selection to the given argument")
fmt.Fprintln(f, "")
fmt.Fprintln(f, "Options:")
flag.PrintDefaults()
}
showDoc := flag.Bool( showDoc := flag.Bool(
"doc", "doc",
false, false,