Files
i2v/cmd/cli/commands.go

50 lines
950 B
Go

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
},
}
}