Skip to content

Commit

Permalink
flush
Browse files Browse the repository at this point in the history
  • Loading branch information
ms-jpq committed Mar 20, 2024
1 parent e13a865 commit 84fe878
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion gay
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ def _parse_args() -> Namespace:
)

with nullcontext(parser.add_argument_group()) as opt_group:
opt_group.add_argument("-u", "--unbuffered", action="store_true")
opt_group.add_argument(
"-c",
"--colour",
Expand Down Expand Up @@ -578,7 +579,12 @@ def _main() -> None:
rgb_gen=rgb_gen,
stream=normalized_stream,
)
stdout.writelines(gen)
if args.unbuffered:
for s in gen:
stdout.write(s)
stdout.flush()
else:
stdout.writelines(gen)


try:
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ long_description = file: README.md
long_description_content_type = text/markdown
name = gay
url = https://github.com/ms-jpq/gay
version = 1.3.3
version = 1.3.4

[options]
packages =
Expand Down

0 comments on commit 84fe878

Please sign in to comment.