aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/index.go
diff options
context:
space:
mode:
authorJP Appel <jeanpierre.appel01@gmail.com>2025-07-23 02:07:08 -0400
committerJP Appel <jeanpierre.appel01@gmail.com>2025-07-23 02:07:08 -0400
commitf949689b4d56daa9988c821e2f0e1b470cfc7275 (patch)
tree30cd47a5bd6a6598c4b10a107e72767c36262522 /cmd/index.go
parent8633ab4bc13bf957d7598700338c8d0e251e0cfa (diff)
Update help info
Diffstat (limited to 'cmd/index.go')
-rw-r--r--cmd/index.go22
1 files changed, 7 insertions, 15 deletions
diff --git a/cmd/index.go b/cmd/index.go
index 5454a8a..358182c 100644
--- a/cmd/index.go
+++ b/cmd/index.go
@@ -23,7 +23,7 @@ func SetupIndexFlags(args []string, fs *flag.FlagSet, flags *IndexFlags) {
flags.ParseMeta = true
fs.BoolVar(&flags.IgnoreDateError, "ignoreBadDates", false, "ignore malformed dates while indexing")
fs.BoolVar(&flags.IgnoreMetaError, "ignoreMetaError", false, "ignore errors while parsing general YAML header info")
- fs.BoolFunc("ignoreMeta", "don't parse YAML header values other title, authors, date, tags", func(s string) error {
+ fs.BoolFunc("ignoreMeta", "only parse title, authors, date, tags from YAML headers", func(s string) error {
flags.ParseMeta = false
return nil
})
@@ -33,20 +33,6 @@ func SetupIndexFlags(args []string, fs *flag.FlagSet, flags *IndexFlags) {
})
fs.BoolVar(&flags.IgnoreHidden, "ignoreHidden", false, "ignore hidden files while crawling")
- fs.Usage = func() {
- f := fs.Output()
- fmt.Fprintf(f, "Usage of %s %s\n", os.Args[0], fs.Name())
- fmt.Fprintf(f, " %s [global-flags] %s [index-flags] <subcommand>\n\n", os.Args[0], fs.Name())
- fmt.Fprintln(f, "Subcommands:")
- fmt.Fprintln(f, "build - create a new index")
- fmt.Fprintln(f, "update - update an existing index")
- fmt.Fprintln(f, "tidy - cleanup an index")
- fmt.Fprintln(f, "\nIndex Flags:")
- fs.PrintDefaults()
- fmt.Fprintln(f, "\nGlobal Flags:")
- flag.PrintDefaults()
- }
-
customFilters := false
flags.Filters = index.DefaultFilters()
fs.Func("filter",
@@ -67,6 +53,12 @@ func SetupIndexFlags(args []string, fs *flag.FlagSet, flags *IndexFlags) {
return nil
})
+ fs.Usage = func() {
+ f := fs.Output()
+ Help("index", f)
+ PrintGlobalFlags(f)
+ }
+
fs.Parse(args)
remainingArgs := fs.Args()