From 761aa2348379ea083d4cb510be57870cfc31409a Mon Sep 17 00:00:00 2001 From: Christian Zangl Date: Fri, 4 Feb 2022 21:32:34 +0100 Subject: [PATCH] add select-path to -help (#749) --- gen/man.sh | 2 +- lf.1 | 2 +- main.go | 12 ++++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/gen/man.sh b/gen/man.sh index 099a266..f1eda46 100755 --- a/gen/man.sh +++ b/gen/man.sh @@ -35,7 +35,7 @@ lf \- terminal file manager .OP \-single .OP \-version .OP \-help -.RI [ directory ] +.RI [ select-path ] .YS .SH DESCRIPTION END diff --git a/lf.1 b/lf.1 index 98576ab..814fad3 100644 --- a/lf.1 +++ b/lf.1 @@ -16,7 +16,7 @@ lf \- terminal file manager .OP \-single .OP \-version .OP \-help -.RI [ directory ] +.RI [ select-path ] .YS .SH DESCRIPTION lf is a terminal file manager. diff --git a/main.go b/main.go index 46a7d5e..11f677b 100644 --- a/main.go +++ b/main.go @@ -185,6 +185,18 @@ func checkServer() { } 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( "doc", false,