impl -e=best-ass-to-srt

This commit is contained in:
Bel LaPointe
2025-06-01 09:55:01 -06:00
parent 10a40d4a54
commit 0afb6535b6

View File

@@ -47,6 +47,13 @@ func Main(ctx context.Context, args []string) error {
}
}
return nil
case BestAssToSRT:
for _, pos := range flags.Pos {
if err := inass.BestAssToSRT(ctx, pos); err != nil {
return err
}
}
return nil
default:
panic(flags.Entrypoint.String())
}
@@ -58,6 +65,7 @@ type Entrypoint int
const (
Defacto Entrypoint = iota
DeportAss
BestAssToSRT
)
func (e *Entrypoint) Set(s string) error {
@@ -66,10 +74,13 @@ func (e *Entrypoint) Set(s string) error {
*e = Defacto
case DeportAss.String():
*e = DeportAss
case BestAssToSRT.String():
*e = BestAssToSRT
default:
return fmt.Errorf("%s nin (%s)", s, strings.Join([]string{
Defacto.String(),
DeportAss.String(),
BestAssToSRT.String(),
}, ", "))
}
return nil
@@ -81,6 +92,8 @@ func (e Entrypoint) String() string {
return ""
case DeportAss:
return "deport-ass"
case BestAssToSRT:
return "best-ass-to-srt"
}
panic("cannot serialize entrypoint")
}