Skip to content

chore: email-messages update shouldn't overwrite by default#71

Merged
notnmeyer merged 2 commits into
mainfrom
chore/email-messages-update-should-require-explicit-revision
May 12, 2026
Merged

chore: email-messages update shouldn't overwrite by default#71
notnmeyer merged 2 commits into
mainfrom
chore/email-messages-update-should-require-explicit-revision

Conversation

@notnmeyer

@notnmeyer notnmeyer commented May 8, 2026

Copy link
Copy Markdown
Member

no overwrite-by-default behavior,

 ➜ task -- email-messages update blah --lmx "<H1>hello</H1>"

   ERROR

  At least one of the flags in the group [expected-revision-id force] is required.

exit status 1
task: Failed to run task "default": exit status 1

revision id is set the same way,

➜ task -- email-messages update blah --lmx "<H1>hello</H1>" -r blah
Updated.
...

the previous behavior (looking up and sending the most recent revision) is behind --force/-f,

➜ task -- email-messages update blah --lmx "<H1>hello</H1>" --force
Updated.
...

you cant use --force and --expected-revision-id together,

➜ task -- email-messages update blah --lmx "<H1>hello</H1>" -r blah -f

   ERROR

  If any flags in the group [expected-revision-id force] are set none of the others can be; [expected-revision-id force] were all set.

@notnmeyer notnmeyer self-assigned this May 8, 2026
@notnmeyer notnmeyer marked this pull request as ready for review May 8, 2026 20:08
@notnmeyer notnmeyer requested a review from chrisfrantz May 8, 2026 20:08
@danrowden

Copy link
Copy Markdown
Contributor

Might be nicer to comma-separate the flags? [expected-revision-id, force] Not sure if that's helpful for agents but as a human, it's easier to grok

@notnmeyer

notnmeyer commented May 12, 2026

Copy link
Copy Markdown
Member Author

Might be nicer to comma-separate the flags? [expected-revision-id, force] Not sure if that's helpful for agents but as a human, it's easier to grok

what you're seeing is the default formatting from cobra. its hardcoded in that format, https://github.com/spf13/cobra/blob/main/flag_groups.go#L183. we could replace their functions with our own, but meh. its currently at least consistent across commands that use flag groups.

@chrisfrantz chrisfrantz requested a review from askkaz May 12, 2026 14:16
@notnmeyer notnmeyer merged commit 3794986 into main May 12, 2026
2 checks passed
@notnmeyer notnmeyer deleted the chore/email-messages-update-should-require-explicit-revision branch May 12, 2026 20:55
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.

3 participants