Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to omit binary content even when writing to a file #2927

Open
max-sixty opened this issue Apr 4, 2024 · 3 comments
Open

Option to omit binary content even when writing to a file #2927

max-sixty opened this issue Apr 4, 2024 · 3 comments
Labels
feature-request New feature or request

Comments

@max-sixty
Copy link

I'm trying to write a repo of files all to a single file. I'd like to take advantage of bats feature to omit writing binary files.

But when piping output to a file, bat writes binary files. I think -f avoids writing binary files, but will then write colors, which I don't want.

I think it would work to have the opposite of --all (ref #2043), which will write binary even when writing to a TTY. Possibly this synthesizes to an option of --display-binary/--skip-binary...?

@max-sixty max-sixty added the feature-request New feature or request label Apr 4, 2024
@domenicomastrangelo
Copy link

Hi @max-sixty, could you confirm that the command you're trying to execute is similar to this:

bat * -p -A | tee output.txt

I was able to reproduce what you pointed out as the output.txt file will contain the executables in the folder.

The same output is created from cat, so I don't know if the project wants to deviate from it adding a separate feature.

If someone agrees with this feature request, I'd be happy to give it a go :)

@max-sixty
Copy link
Author

Hi @max-sixty, could you confirm that the command you're trying to execute is similar to this:

bat * -p -A | tee output.txt

Yes that's correct!

The same output is created from cat, so I don't know if the project wants to deviate from it adding a separate feature.

Yes, my suggestion was a --display-binary/--skip-binary flag...

@domenicomastrangelo
Copy link

Yeah, i think it's a good idea. I could implement something for this if nobody has anything against it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants