Skip to content

Commit 24c9be3

Browse files
pepa65jwerle
authored andcommitted
Tldr bash client (#32)
* First submission of tldr-bash-client * Added commandline option --version * Remove extraneous empty line due to 'resolving conflicts' on github * Update to version 0.3
1 parent e24a4d9 commit 24c9be3

File tree

1 file changed

+41
-16
lines changed

1 file changed

+41
-16
lines changed

_posts/2017-02-06-tldr-bash-client.md

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ tags: [color, github, docs, client, markdown, bash]
99

1010
* Source code repo: https://github.com/pepa65/tldr-bash-client
1111
* Author: pepa65 <[email protected]>
12+
* Version: 0.3
1213

1314
# tldr-bash-client
1415

1516
**A fully-functional [bash](https://tiswww.case.edu/php/chet/bash/bashtop.html)
16-
client for the [tldr](https://github.com/rprieto/tldr/) project, providing
17+
client for the [tldr](https://github.com/tldr-pages/tldr) project, providing
1718
poignant examples of terminal commands.**
1819

1920
## Installation
@@ -27,55 +28,79 @@ sudo chmod +x $location
2728
```
2829

2930
If the location is not in $PATH, you need to specify the path to run it.
31+
Alternately, you can do `sudo bpkg-install pepa65/tldr` if you have
32+
[bpkg](https://github.com/bpkg/bpkg) installed.
3033

3134
### Prerequisites
3235
coreutils, less, grep, unzip, curl / wget
3336

3437
## Usage
3538

3639
```
37-
USAGE: tldr [option] [platform/]<command>
40+
USAGE: tldr [option] [platform/]command
3841
39-
platform/command: Show page for command (from platform)
42+
[platform/]command: Show page for command (from platform)
4043
4144
platform is optionally one of: common, linux, osx, sunos
4245
4346
option is optionally one of:
4447
-l, --list [platform]: Show all available pages (from platform)
45-
-r, --render <file>: Render a local file as tldr markdown
46-
-m, --markdown <command>: Show the markdown source for command
48+
-r, --render file: Render a local file as tldr markdown
49+
-m, --markdown command: Show the markdown source for command
4750
-c, --cache: Cache all pages by downloading archive from repo
4851
-u, --update: Re-download index file from repo
49-
5052
-v, --version: Version number and repo location
5153
[-h, -?, --help]: This help overview
5254
53-
All pages and the index are cached locally under ~/.config/tldr
54-
By default, the cached copies will be re-downloaded after 60 days
55+
All pages and the index are cached locally under $HOME/.local/share/tldr
56+
By default, the cached copies will be freshly downloaded after 60 days.
5557
```
5658

5759
## Customisation
5860

59-
The colors and other styling of the 5 elements of tldr pages can be modified
60-
either by editing the first few lines of the scipt, or by setting the following
61-
environment variables:
61+
The 5 elements in TLDR markup that can be styled with these colors and
62+
backgrounds (last one specified will be used) and modes (more can apply):
63+
* Colors: Black, Red, Green, Yellow, Blue, Magenta, Cyan, White
64+
* BG: BlackBG, RedBG, GreenBG, YellowBG, BlueBG, MagentaBG, CyanBG, WhiteBG
65+
* Modes: Bold, Underline, Italic, Inverse
6266

67+
`Newline` can be added to the style list to add a newline before the element
68+
and `Space` to add a space at the start of the line
69+
(style items are separated by space, lower/uppercase mixed allowed)
6370
* TLDR_TITLE_STYLE (defaults to: Newline Space Bold Yellow)
6471
* TLDR_DESCRIPTION_STYLE (defaults to: Space Yellow)
65-
* TLDR_EXAMPLE_STYLE (defaults to: Newline Bold Green)
72+
* TLDR_EXAMPLE_STYLE (defaults to: Newline Space Bold Green)
6673
* TLDR_CODE_STYLE (defaults to: Space Bold Blue)
67-
* TLDR_VALUE_STYLE (defaults to: Bold Cyan)
74+
* TLDR_VALUE_ISTYLE (defaults to: Space Bold Cyan)
75+
76+
The Value style (above) is an Inline style: doesn't take Newline or Space
77+
78+
Inline styles for help text: default, URL, option, platform, command, header
79+
* TLDR_DEFAULT_ISTYLE (defaults to: White)
80+
* TLDR_URL_ISTYLE (defaults to: Yellow)
81+
* TLDR_HEADER_ISTYLE (defaults to: Bold)
82+
* TLDR_OPTION_ISTYLE (defaults to: Bold Yellow)
83+
* TLDR_PLATFORM_ISTYLE (defaults to: Bold Blue)
84+
* TLDR_COMMAND_ISTYLE (defaults to: Bold Cyan)
85+
* TLDR_FILE_ISTYLE (defaults to: Bold Magenta)
6886

69-
Also the error color and page expiry can easily be set:
87+
Color/BG (Newline and Space also allowed) for error and info messages
88+
* TLDR_ERROR_COLOR (defaults to: Newline Space Red)
89+
* TLDR_INFO_COLOR (defaults to: Newline Space Green)
7090

71-
* TLDR_ERROR_COLOR (defaults to: Space Red)
91+
How many days before freshly downloading a potentially stale page
7292
* TLDR_EXPIRY (defaults to: 60)
7393

94+
Alternative location of pages cache
95+
* TLDR_CACHE (not set by default)
96+
7497
## Contributing
7598

7699
Please file an issue for a question, a bug or a feature request.
77100
Or even better, send a pull request!
78101

79102
### License
80103

81-
Relicensed under GPL v3+
104+
Original client by Ray Lee http://github.com/raylee/tldr (MIT license)
105+
106+
Relicensed under GPLv3+

0 commit comments

Comments
 (0)