-
-
Notifications
You must be signed in to change notification settings - Fork 103
Expand file tree
/
Copy pathhelp
More file actions
executable file
·34 lines (30 loc) · 800 Bytes
/
Copy pathhelp
File metadata and controls
executable file
·34 lines (30 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
#
# Display the tldr help page to show docs from `~/dotfiles/docs` or `~/dotfiles/bin` dirs or default to the tldr-pages project.
# > More information: <https://github.com/tldr-pages/tlrc>.
#
# - Print the tldr page for `docs/README.md``:
#
# `help`
#
# - Print the tldr page for a specific command (hint: this is how you got here!):
#
# `help {{command}}`
#
# ---
# Author: Nick Plekhanov, https://plekhanov.me
# License: MIT
# https://github.com/nicksp/dotfiles
cd "$(dirname "$0")/.." || exit
DOTFILES_DIR="$(pwd)"
config="$DOTFILES_DIR/tilde/.tlrc.toml"
if [[ "$1" != "" ]]; then
md="$("$DOTFILES_DIR"/bin/lib/get-tldr-md "$1")"
else
md="$DOTFILES_DIR/docs/README.md"
fi
if [ "$md" != "" ]; then
tldr --config "$config" --render "$md"
else
tldr --config "$config" "$@"
fi