From c4f1163a941422f71ca8bf038c9bb60ecbd9ce1d Mon Sep 17 00:00:00 2001 From: Stein Ivar Berghei Date: Tue, 16 Apr 2024 10:17:29 +0200 Subject: [PATCH] Add DefaultOptions --- guessit.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/guessit.go b/guessit.go index e9eaa13..17110b5 100644 --- a/guessit.go +++ b/guessit.go @@ -15,6 +15,7 @@ type GuessitConfig struct { type Guessit struct { GuessitConfig + DefaultOptions []string } type Match struct { @@ -105,11 +106,12 @@ func New(conf GuessitConfig) (Guessit, error) { } } - return Guessit{conf}, nil + return Guessit{conf, []string{}}, nil } func (g Guessit) Guessit(s string, options ...string) (out Match, err error) { args := []string{"-m", "guessit", s} + args = append(args, g.DefaultOptions...) args = append(args, options...) args = append(args, "--json")