-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathcount_command.go
More file actions
26 lines (24 loc) · 747 Bytes
/
count_command.go
File metadata and controls
26 lines (24 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package main
import (
"github.com/ccremer/clustercode/pkg/countcmd"
"github.com/urfave/cli/v2"
controllerruntime "sigs.k8s.io/controller-runtime"
)
func newCountCommand() *cli.Command {
command := &countcmd.Command{}
return &cli.Command{
Name: "count",
Usage: "Counts the number of generated intermediary media files",
Before: LogMetadata,
Action: func(ctx *cli.Context) error {
command.Log = AppLogger(ctx).WithName(ctx.Command.Name)
controllerruntime.SetLogger(command.Log)
return command.Execute(controllerruntime.LoggerInto(ctx.Context, command.Log))
},
Flags: []cli.Flag{
newTaskNameFlag(&command.TaskName),
newNamespaceFlag(&command.Namespace),
newSourceRootDirFlag(&command.SourceRootDir),
},
}
}