aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/index.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/cmd/index.go b/cmd/index.go
index f3fa23f..5183870 100644
--- a/cmd/index.go
+++ b/cmd/index.go
@@ -21,12 +21,17 @@ type IndexFlags struct {
func SetupIndexFlags(args []string, fs *flag.FlagSet, flags *IndexFlags) {
flags.ParseLinks = true
flags.ParseMeta = true
+ flags.ParseHeadings = 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", "only parse title, authors, date, tags from YAML headers", func(s string) error {
flags.ParseMeta = false
return nil
})
+ fs.BoolFunc("ignoreHeadings", "don't parse file contents for section headings", func(s string) error {
+ flags.ParseHeadings = false
+ return nil
+ })
fs.BoolFunc("ignoreLinks", "don't parse file contents for links", func(s string) error {
flags.ParseLinks = false
return nil
@@ -126,6 +131,3 @@ func RunIndex(gFlags GlobalFlags, iFlags IndexFlags, db *data.Query) byte {
return 0
}
-
-func init() {
-}