Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Bug Fixes
* Make the return value of `FavoriteQueries.list()` a copy.
* Make multi-line detection and special cases more robust.
* Run empty `--execute` arguments instead of ignoring the flag.
* Exit with error when the `--batch` argument is an empty string.


Internal
Expand Down
4 changes: 2 additions & 2 deletions mycli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2664,10 +2664,10 @@ def get_password_from_file(password_file: str | None) -> str | None:
if cli_args.execute is not None:
sys.exit(main_execute_from_cli(mycli, cli_args))

if cli_args.batch and cli_args.batch != '-' and cli_args.progress and sys.stderr.isatty():
if cli_args.batch is not None and cli_args.batch != '-' and cli_args.progress and sys.stderr.isatty():
sys.exit(main_batch_with_progress_bar(mycli, cli_args))

if cli_args.batch:
if cli_args.batch is not None:
sys.exit(main_batch_without_progress_bar(mycli, cli_args))

if not sys.stdin.isatty():
Expand Down
4 changes: 2 additions & 2 deletions mycli/main_modes/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def dispatch_batch_statements(

def main_batch_with_progress_bar(mycli: 'MyCli', cli_args: 'CliArgs') -> int:
goal_statements = 0
if not cli_args.batch:
if cli_args.batch is None:
return 1
if not sys.stdin.isatty() and cli_args.batch != '-':
click.secho('Ignoring STDIN since --batch was also given.', err=True, fg='yellow')
Expand Down Expand Up @@ -108,7 +108,7 @@ def main_batch_with_progress_bar(mycli: 'MyCli', cli_args: 'CliArgs') -> int:


def main_batch_without_progress_bar(mycli: 'MyCli', cli_args: 'CliArgs') -> int:
if not cli_args.batch:
if cli_args.batch is None:
return 1
if not sys.stdin.isatty() and cli_args.batch != '-':
click.secho('Ignoring STDIN since --batch was also given.', err=True, fg='red')
Expand Down
Loading