Skip to content

Commit 24c11e5

Browse files
pepa65jwerle
authored andcommitted
First submission of tldr-bash-client (#30)
1 parent f9a5501 commit 24c11e5

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed

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

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
layout: post
3+
title: "tldr bash client"
4+
description: "Display tldr pages: community driven man-by-example"
5+
category: default
6+
tags: [color, github, docs, client, markdown, bash]
7+
---
8+
{% include JB/setup %}
9+
Source code repo: https://github.com/pepa65/tldr-bash-client
10+
Author: pepa65 <[email protected]>
11+
12+
# tldr-bash-client
13+
14+
**A fully-functional [bash](https://tiswww.case.edu/php/chet/bash/bashtop.html)
15+
client for the [tldr](https://github.com/rprieto/tldr/) project, providing
16+
poignant examples of terminal commands.**
17+
18+
## Installation
19+
20+
Download the tldr bash script to the install location:
21+
22+
```bash
23+
location=/usr/local/bin/tldr # elevated privileges needed for some locations
24+
sudo wget -qO $location https://raw.githubusercontent.com/pepa65/tldr-bash-client/master/tldr
25+
sudo chmod +x $location
26+
```
27+
28+
If the location is not in $PATH, you need to specify the path to run it.
29+
30+
### Prerequisites
31+
coreutils, less, grep, unzip, curl / wget
32+
33+
## Usage
34+
35+
```
36+
USAGE: tldr [option] [platform/]<command>
37+
38+
platform/command: Show page for command (from platform)
39+
40+
platform is optionally one of: common, linux, osx, sunos
41+
42+
option is optionally one of:
43+
-l, --list [platform]: Show all available pages (from platform)
44+
-r, --render <file>: Render a local file as tldr markdown
45+
-m, --markdown <command>: Show the markdown source for command
46+
-c, --cache: Cache all pages by downloading archive from repo
47+
-u, --update: Re-download index file from repo
48+
[-h, -?, --help]: This help overview
49+
50+
All pages and the index are cached locally under ~/.config/tldr.
51+
By default, the cached copies will be re-downloaded after 60 days.
52+
```
53+
54+
## Customisation
55+
The colors and other styling of the 5 elements of tldr pages can be modified
56+
either by editing the first few lines of the scipt, or by setting the following
57+
environment variables:
58+
* TLDR_TITLE_STYLE (defaults to: Newline Space Bold Yellow)
59+
* TLDR_DESCRIPTION_STYLE (defaults to: Space Yellow)
60+
* TLDR_EXAMPLE_STYLE (defaults to: Newline Bold Green)
61+
* TLDR_CODE_STYLE (defaults to: Space Bold Blue)
62+
* TLDR_VALUE_STYLE (defaults to: Bold Cyan)
63+
64+
Also the error color and page expiry can easily be set:
65+
* TLDR_ERROR_COLOR (defaults to: Red)
66+
* TLDR_EXPIRY (defaults to: 60)
67+
68+
## Contributing
69+
70+
Please file an issue for a question, a bug or a feature request.
71+
Or even better, send a pull request!
72+
73+
### License
74+
75+
Relicensed under GPL v3+

0 commit comments

Comments
 (0)