create a cli tool for turning images into videos
This commit is contained in:
49
cmd/cli/commands.go
Normal file
49
cmd/cli/commands.go
Normal 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
|
||||
},
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user