Skip to content

Make batch execution noninteractive by default#1951

Merged
rolandwalker merged 1 commit into
mainfrom
RW/batch-default-non-interactive
Jun 23, 2026
Merged

Make batch execution noninteractive by default#1951
rolandwalker merged 1 commit into
mainfrom
RW/batch-default-non-interactive

Conversation

@rolandwalker

@rolandwalker rolandwalker commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Description

  • replace --noninteractive flag with --warn-batch, with an inverted meaning
  • when --warn-batch is set, it overrides myclirc's destructive_warning setting
  • let --execute work exactly like --batch
  • send destructive-query confirmation prompts to the standard error, since users running batch scripts will often have the standard output redirected

This is a breaking change, not least because the --noninteractive flag no longer has an effect, and disappears from the docs. But passing it causes a Click warning referring the user to --warn-batch.

Preparation for release 2.0.

Checklist

  • I added this contribution to the changelog.md file.
  • I added my name to the AUTHORS file (or it's already there).
  • To lint and format the code, I ran
    uv run ruff check && uv run ruff format && uv run mypy --install-types .

@rolandwalker rolandwalker self-assigned this Jun 20, 2026
@rolandwalker rolandwalker force-pushed the RW/batch-default-non-interactive branch from d7041fb to 44869ab Compare June 22, 2026 09:17
Comment thread mycli/main.py Outdated
clickdc=None,
help='Warn before running a destructive query.',
)
batch_warn: bool = clickdc.option(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like destructive_warning is set to True by default, but the new batch_warn is False by default (default Click value for bool). Might be worth calling that out in the changelog, or setting batch_warn to True by default. Could see that one getting some people unexpectedly

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The intent of the PR is for batch mode to be non-interactive by default. Added to the changelog, updating the name of the flag as well.

 * replace --noninteractive flag with --warn-batch, with an inverted
   meaning
 * when --warn-batch is set, it overrides myclirc's destructive_warning
   setting
 * let --execute work exactly like --batch
 * send destructive-query confirmation prompts to the standard error,
   since users running batch scripts will often have the standard
   output redirected

This is a breaking change, not least because the --noninteractive flag
no longer has an effect, and disappears from the docs.  But passing it
causes a Click warning referring the user to --warn-batch.

Preparation for release 2.0.
@rolandwalker rolandwalker force-pushed the RW/batch-default-non-interactive branch from 44869ab to 51c1839 Compare June 23, 2026 09:10
@rolandwalker rolandwalker merged commit f3b0ea1 into main Jun 23, 2026
11 checks passed
@rolandwalker rolandwalker deleted the RW/batch-default-non-interactive branch June 23, 2026 22:51
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