impl -e=best-ass-to-srt
parent
10a40d4a54
commit
0afb6535b6
|
|
@ -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")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue