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