~kota/gemgen

697c934553892e3f6f131ead03b79cb84971a19f — Dakota Walsh 2 years ago 2cc111a
fix errors messages for link flags
1 files changed, 2 insertions(+), 3 deletions(-)

M options/options.go
M options/options.go => options/options.go +2 -3
@@ 4,7 4,6 @@ import (
	"bytes"
	"errors"
	"fmt"
	"log"
	"os"

	gem "git.sr.ht/~kota/goldmark-gemtext"


@@ 111,7 110,7 @@ func ParseArgs(progname string, args []string) (*Opts, string, error) {
	case "below":
		opts.GemOptions = append(opts.GemOptions, gem.WithHeadingLink(gem.HeadingLinkBelow))
	default:
		log.Println("unknown link mode")
		return nil, "", fmt.Errorf("heading link flag type %s is invalid", *headingLinkFlag)
	}

	switch *paragraphLinkFlag {


@@ 119,7 118,7 @@ func ParseArgs(progname string, args []string) (*Opts, string, error) {
	case "off":
		opts.GemOptions = append(opts.GemOptions, gem.WithParagraphLink(gem.ParagraphLinkOff))
	default:
		log.Println("unknown link mode")
		return nil, "", fmt.Errorf("paragraph link flag type %s is invalid", *paragraphLinkFlag)
	}
	return &opts, buf.String(), nil
}