From f949689b4d56daa9988c821e2f0e1b470cfc7275 Mon Sep 17 00:00:00 2001 From: JP Appel Date: Wed, 23 Jul 2025 02:07:08 -0400 Subject: Update help info --- cmd/index.go | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'cmd/index.go') 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] \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() -- cgit v1.2.3