Skip to content

Commit

Permalink
Use MARKUT as the default markut file
Browse files Browse the repository at this point in the history
  • Loading branch information
rexim committed Sep 6, 2024
1 parent 0ac17aa commit b15dd6d
Showing 1 changed file with 7 additions and 50 deletions.
57 changes: 7 additions & 50 deletions markut.go
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ func ffmpegGenerateConcatList(chunks []Chunk, outputPath string) error {

func finalSubcommand(args []string) bool {
subFlag := flag.NewFlagSet("final", flag.ContinueOnError)
markutPtr := subFlag.String("markut", "", "Path to the Markut file with markers (mandatory)")
markutPtr := subFlag.String("markut", "MARKUT", "Path to the Markut file with markers (mandatory)")
patchPtr := subFlag.Bool("patch", false, "Patch modified cuts")

err := subFlag.Parse(args)
Expand All @@ -828,13 +828,6 @@ func finalSubcommand(args []string) bool {
return false
}

if *markutPtr == "" {
subFlag.Usage()
fmt.Printf("ERROR: No -markut file is provided\n")
return false
}


context := defaultContext()
ok := context.evalMarkutFile(*markutPtr) && context.finishEval()
if !ok {
Expand Down Expand Up @@ -885,7 +878,7 @@ func finalSubcommand(args []string) bool {

func cutSubcommand(args []string) bool {
subFlag := flag.NewFlagSet("cut", flag.ContinueOnError)
markutPtr := subFlag.String("markut", "", "Path to the Markut file with markers (mandatory)")
markutPtr := subFlag.String("markut", "MARKUT", "Path to the Markut file with markers (mandatory)")

err := subFlag.Parse(args)
if err == flag.ErrHelp {
Expand All @@ -897,12 +890,6 @@ func cutSubcommand(args []string) bool {
return false
}

if *markutPtr == "" {
subFlag.Usage()
fmt.Printf("ERROR: No -markut file is provided\n")
return false
}

context := defaultContext()
ok := context.evalMarkutFile(*markutPtr) && context.finishEval()
if !ok {
Expand Down Expand Up @@ -964,7 +951,7 @@ func cutSubcommand(args []string) bool {

func summarySubcommand(args []string) bool {
summFlag := flag.NewFlagSet("summary", flag.ContinueOnError)
markutPtr := summFlag.String("markut", "", "Path to the Markut file with markers (mandatory)")
markutPtr := summFlag.String("markut", "MARKUT", "Path to the Markut file with markers (mandatory)")

err := summFlag.Parse(args)

Expand All @@ -977,12 +964,6 @@ func summarySubcommand(args []string) bool {
return false
}

if *markutPtr == "" {
summFlag.Usage()
fmt.Printf("ERROR: No -markut file is provided\n");
return false
}

context := defaultContext();
ok := context.evalMarkutFile(*markutPtr) && context.finishEval()
if !ok {
Expand All @@ -1003,7 +984,7 @@ func captionsRingPush(ring []ChatMessage, message ChatMessage, capacity int) []C

func chatSubcommand(args []string) bool {
chatFlag := flag.NewFlagSet("chat", flag.ContinueOnError)
markutPtr := chatFlag.String("markut", "", "Path to the Markut file with markers (mandatory)")
markutPtr := chatFlag.String("markut", "MARKUT", "Path to the Markut file with markers (mandatory)")

err := chatFlag.Parse(args)

Expand All @@ -1016,12 +997,6 @@ func chatSubcommand(args []string) bool {
return false
}

if *markutPtr == "" {
chatFlag.Usage()
fmt.Printf("ERROR: No -markut file is provided\n");
return false
}

context := defaultContext()
ok := context.evalMarkutFile(*markutPtr) && context.finishEval()
if !ok {
Expand Down Expand Up @@ -1057,7 +1032,7 @@ func chatSubcommand(args []string) bool {

func chunkSubcommand(args []string) bool {
subFlag := flag.NewFlagSet("chunk", flag.ContinueOnError)
markutPtr := subFlag.String("markut", "", "Path to the Markut file with markers (mandatory)")
markutPtr := subFlag.String("markut", "MARKUT", "Path to the Markut file with markers (mandatory)")
chunkPtr := subFlag.Int("chunk", 0, "Chunk number to render")

err := subFlag.Parse(args)
Expand All @@ -1071,12 +1046,6 @@ func chunkSubcommand(args []string) bool {
return false
}

if *markutPtr == "" {
subFlag.Usage()
fmt.Printf("ERROR: No -markut file is provided\n")
return false
}

context := defaultContext();
ok := context.evalMarkutFile(*markutPtr) && context.finishEval()
if !ok {
Expand Down Expand Up @@ -1134,7 +1103,7 @@ func fixupSubcommand(args []string) bool {

func pruneSubcommand(args []string) bool {
subFlag := flag.NewFlagSet("prune", flag.ContinueOnError)
markutPtr := subFlag.String("markut", "", "Path to the Markut file with markers (mandatory)")
markutPtr := subFlag.String("markut", "MARKUT", "Path to the Markut file with markers (mandatory)")

err := subFlag.Parse(args)

Expand All @@ -1147,12 +1116,6 @@ func pruneSubcommand(args []string) bool {
return false
}

if *markutPtr == "" {
subFlag.Usage()
fmt.Printf("ERROR: No -markut file is provided\n")
return false
}

context := defaultContext();
ok := context.evalMarkutFile(*markutPtr) && context.finishEval()
if !ok {
Expand Down Expand Up @@ -1187,7 +1150,7 @@ func pruneSubcommand(args []string) bool {
// TODO: Maybe watch mode should just be a flag for the `final` subcommand
func watchSubcommand(args []string) bool {
subFlag := flag.NewFlagSet("watch", flag.ContinueOnError)
markutPtr := subFlag.String("markut", "", "Path to the Markut file with markers (mandatory)")
markutPtr := subFlag.String("markut", "MARKUT", "Path to the Markut file with markers (mandatory)")
skipcatPtr := subFlag.Bool("skipcat", false, "Skip concatenation step")

err := subFlag.Parse(args)
Expand All @@ -1201,12 +1164,6 @@ func watchSubcommand(args []string) bool {
return false
}

if *markutPtr == "" {
subFlag.Usage()
fmt.Printf("ERROR: No -markut file is provided\n")
return false
}

fmt.Printf("INFO: Waiting for updates to %s\n", *markutPtr)
for {
// NOTE: always use rsync(1) for updating the MARKUT file remotely.
Expand Down

0 comments on commit b15dd6d

Please sign in to comment.