Skip to content

Commit c7a39d0

Browse files
committed
CHTSH_CONF specifies location of cht.sh.conf (fixes chubin#59)
1 parent 1501515 commit c7a39d0

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@ Type `help` for other internal `cht.sh` commands.
284284
cht.sh/go> /python zip list
285285
```
286286

287-
The `cht.sh` client has its configuration file which is located at `~/.cht.sh/cht.sh.conf`.
287+
The `cht.sh` client has its configuration file which is located at `~/.cht.sh/cht.sh.conf`
288+
(location of the file can be overriden by the environment variable `CHTSH_CONF`).
288289
Use it to specify query options that you would use with each query.
289290
For example, to switch syntax highlighting off create the file with the following
290291
content:

share/cht.sh.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,13 @@ gen_random_str()
133133
fi
134134
)
135135

136-
if [ -e "$HOME"/.cht.sh/cht.sh.conf ]; then
136+
if [ -z "$CHTSH_CONF" ]; then
137+
CHTSH_CONF="$HOME"/.cht.sh/cht.sh.conf
138+
fi
139+
140+
if [ -e "$CHTSH_CONF" ]; then
137141
# shellcheck disable=SC1090,SC2002
138-
. "$HOME"/.cht.sh/cht.sh.conf
142+
. "$CHTSH_CONF"
139143
fi
140144

141145
if [ "$1" = --read ]; then

0 commit comments

Comments
 (0)