create a cli tool for turning images into videos

This commit is contained in:
2023-12-22 23:14:48 -07:00
commit 6e2ed13e38
9 changed files with 389 additions and 0 deletions

49
cmd/cli/commands.go Normal file
View File

@ -0,0 +1,49 @@
package main
import (
"fmt"
"github.com/urfave/cli/v2"
)
//func startCmd() *cli.Command {
// return &cli.Command{
// Name: "start",
// Aliases: []string{"s"},
// Usage: "Start the application service",
// Action: func(c *cli.Context) error {
//
// return nil
// },
// }
//}
func getJobResultCmd() *cli.Command {
return &cli.Command{
Name: "get-job-result",
Aliases: []string{"gjr"},
Usage: "Get the result of a job",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "job-id",
Aliases: []string{"id"},
Usage: "The id of the job to get the result of",
Required: true,
},
},
Action: func(c *cli.Context) error {
// get the job id
jobID := c.String("job-id")
// get the output file
output := c.String("output")
// get the job result
err := job(jobID, output)
if err != nil {
return fmt.Errorf("error running job result checker | %w", err)
}
return nil
},
}
}