Files
distributor/internal/cli/run.go

33 lines
639 B
Go

package cli
import (
"context"
"fmt"
"io"
"gitea.maximumdirect.net/eric/distributor/internal/app"
)
func runCommand(ctx context.Context, args []string, stdout, stderr io.Writer) int {
if hasHelp(args) {
printRunHelp(stdout)
return exitOK
}
if len(args) > 0 {
fmt.Fprintf(stderr, "%s: run does not accept options yet: %v\n", app.Name, args)
return exitUsage
}
if err := app.Run(ctx, app.RunOptions{}); err != nil {
return fail(stderr, err)
}
return exitOK
}
func printRunHelp(w io.Writer) {
fmt.Fprint(w, `Usage:
distributor run
The run command is present but distribution behavior is not implemented yet.
`)
}