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 } parsed, ok := parseSourceDiagnosticArgs(stderr, "inspect", args) if !ok { return exitUsage } if err := app.Inspect(ctx, app.InspectOptions{ Path: parsed.Path, ConfigPath: parsed.ConfigPath, PipelineID: parsed.PipelineID, BundlePath: parsed.BundlePath, Stdout: stdout, OutputFormat: parsed.OutputFormat, }); err != nil { return fail(stderr, err) } return exitOK } func printInspectHelp(w io.Writer) { fmt.Fprint(w, `Usage: distributor inspect [--format text|json] distributor inspect --config --pipeline [--bundle ] [--format text|json] Options: --config Path to config file for configured source inspection --pipeline Pipeline id to inspect in config mode --bundle Source-root-relative bundle path to inspect --format text|json Output format Print a normalized summary of local source bundles or a configured pipeline source. `) }