Skip to content

feat: add --dry-run arg#8

Open
robotrory wants to merge 1 commit into
mainfrom
rory/dry-run-arg
Open

feat: add --dry-run arg#8
robotrory wants to merge 1 commit into
mainfrom
rory/dry-run-arg

Conversation

@robotrory
Copy link
Copy Markdown
Contributor

@robotrory robotrory commented Apr 30, 2026

Adds a --dry-run arg so that we can test validation without making real network calls.

@robotrory robotrory requested a review from samstarling April 30, 2026 17:46
Copy link
Copy Markdown
Contributor

@samstarling samstarling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good! One thing to consider is whether we want to split up "global" options from everything else. Now that *CLI gets passed into Run(), BuildPushCmd gets access to things like Auth which ideally it shouldn't need to know anything about.

I think we could solve this by doing something like:

type Globals struct {
    Debug  bool
    JSON   bool
    Quiet  bool
    DryRun bool
}

type CLI struct {
    Globals
    Version kong.VersionFlag
    Auth    AuthCmd  `cmd:""`
    Build   BuildCmd `cmd:""`
}

// Then in main:
kong.Parse(&cli, kong.Vars{...}, kong.Bind(&cli.Globals))

// And in subcommands:
func (c *BuildPushCmd) Run(g *Globals) error { ... }

Not a must-fix by any means, but probably nice to do as we scale the number of commands in here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants