Branching off from #573 - it would be very useful if bat automatically generated a sane, small, well commented config file for users.
For example:
bat --config-file -o $file writes to $file bat --generate-config-file writes to the current default config location and prints the pathI assume the implementation would be a small static string or binary blog baked into the binary. Not sure how rust does these things.
I don't think the -o option is necessary here, you can already redirect the output with > at the command line. The other options look useful though.
I assume the implementation would be a small static string or binary blog baked into the binary. Not sure how rust does these things.
I don't think the
-ooption is necessary here, you can already redirect the output with>at the command line. The other options look useful though.
Good point, but then how should the CLI really look like?
I would expect --config-file to always write to standard out. Does that answer your question?
Not really.
bat --config-file
currently prints the path to the config file, and we are not planning to change that.
The idea of this ticket is to create a new way to generate a default config file, ideally at the place where bat would look for it anyway.
My question is how we want to design the CLI to allow users to do that.
If we are implementing something like bat --print-default-config-file which prints to the console, are we advising users to run something like this?
bat --print-default-config-file > bat --config-file
That wouldn't really work because the ~/.config/bat folder would likely not exist.
Agree with @sharkdp above - that seems pretty clunky. My vote is on this:
$ bat --generate-config-file
Success! Config file written to ~/.config/bat/bat.conf
Under the hood, this command creates the ~/.config/bat folder and writes the config file.
Closed in #885 by @jmick414
Woohoo! You guys rock. Thanks @jmick414 and @sharkdp .
released in bat v0.14
Most helpful comment
I don't think the
-ooption is necessary here, you can already redirect the output with>at the command line. The other options look useful though.