diff --git a/README.md b/README.md index 0fd9c8f2..81a9b16f 100644 --- a/README.md +++ b/README.md @@ -284,7 +284,8 @@ Type `help` for other internal `cht.sh` commands. cht.sh/go> /python zip list ``` -The `cht.sh` client has its configuration file which is located at `~/.cht.sh/cht.sh.conf`. +The `cht.sh` client has its configuration file which is located at `~/.cht.sh/cht.sh.conf` +(location of the file can be overriden by the environment variable `CHTSH_CONF`). Use it to specify query options that you would use with each query. For example, to switch syntax highlighting off create the file with the following content: diff --git a/share/cht.sh.txt b/share/cht.sh.txt index 9af0e465..4be02092 100755 --- a/share/cht.sh.txt +++ b/share/cht.sh.txt @@ -133,9 +133,13 @@ gen_random_str() fi ) -if [ -e "$HOME"/.cht.sh/cht.sh.conf ]; then +if [ -z "$CHTSH_CONF" ]; then + CHTSH_CONF="$HOME"/.cht.sh/cht.sh.conf +fi + +if [ -e "$CHTSH_CONF" ]; then # shellcheck disable=SC1090,SC2002 - . "$HOME"/.cht.sh/cht.sh.conf + . "$CHTSH_CONF" fi if [ "$1" = --read ]; then