Add initial distributor CLI skeleton

This commit is contained in:
2026-05-31 01:47:39 +00:00
parent 0818733b19
commit 22d0424232
19 changed files with 436 additions and 2 deletions

36
internal/cli/inspect.go Normal file
View File

@@ -0,0 +1,36 @@
package cli
import (
"context"
"fmt"
"io"
"gitea.maximumdirect.net/eric/distributor/internal/app"
)
func inspectCommand(ctx context.Context, args []string, stdout, stderr io.Writer) int {
if hasHelp(args) {
printInspectHelp(stdout)
return exitOK
}
if len(args) > 1 {
fmt.Fprintf(stderr, "%s: inspect accepts at most one path\n", app.Name)
return exitUsage
}
var path string
if len(args) == 1 {
path = args[0]
}
if err := app.Inspect(ctx, app.InspectOptions{Path: path}); err != nil {
return fail(stderr, err)
}
return exitOK
}
func printInspectHelp(w io.Writer) {
fmt.Fprint(w, `Usage:
distributor inspect <path>
The inspect command is present but bundle inspection is not implemented yet.
`)
}