Skip to content

Conversation

sharkdp
Copy link
Owner

@sharkdp sharkdp commented Oct 7, 2018

This allows users to create simple configuration file (~/.config/bat/config on Linux) that has the following format:

--flag1
--flag2
--option1=value1
# lines beginning with '#' are ignored
--option2 value2
# empty lines and trailing whitespace are also ignored

--option3=value3
# Flags and options can also be on a single ine:
--flag4 --flag5 --option4 value4

It also adds support for BAT_OPTS environment variable with the same format. It takes precedence over the configuration file.

see #310

@sharkdp sharkdp mentioned this pull request Oct 7, 2018
This allows users to create simple configuration file
(`~/.config/bat/config` on Linux) that has the following format:

    ```bash
    --flag1
    --flag2
    --option1=value1
    # lines beginning with '#' are ignored
    --option2=value2
    # empty lines and trailing whitespace are also ignored

    --option3=value3
    ```
@sharkdp
Copy link
Owner Author

sharkdp commented Oct 11, 2018

There is one thing missing: --style can not be passed in twice, so users will not be able to configure --style in their config file and overwrite it on the command-line later.

@sharkdp sharkdp merged commit 314ec88 into master Oct 16, 2018
@sharkdp sharkdp deleted the bat-config-file branch October 16, 2018 20:09
@SimenB
Copy link

SimenB commented Oct 22, 2018

Would it be possible to set an env variable pointing to the configuration file, similar to ripgrep's $RIPGREP_CONFIG_PATH? I like to keep the config there as I check it into VCS

@sharkdp
Copy link
Owner Author

sharkdp commented Oct 22, 2018

@SimenB Can you please open a new ticket to address this? Thank you

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