Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions tlrc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
title: tlrc
homepage: https://github.com/tldr-pages/tlrc
tagline: |
tlrc: A fast tldr client written in Rust.
---

To update or switch versions, run `webi tlrc@stable` (or `@v1.11`, `@beta`,
etc).

### Files

These are the files / directories that are created and/or modified with this
install:

```text
~/.config/envman/PATH.env
~/.local/bin/tlrc
~/.local/opt/tlrc/
```

## Cheat Sheet

> `tlrc` is a fast tldr client written in Rust. It provides community-maintained
> help pages for command-line tools with practical examples instead of lengthy
> man pages.

To get help for a command:

```sh
tlrc tar
```

### List all available pages

To see all available commands:

```sh
tlrc --list
```

### Update the cache

To update the local cache of tldr pages:

```sh
tlrc --update
```

### Search for commands

To search for commands containing a keyword:

```sh
tlrc --search "compress"
```

### Show examples for specific platform

To show examples for a specific platform:

```sh
tlrc --platform linux tar
```

### Random page

To display a random page:

```sh
tlrc --random
```
43 changes: 43 additions & 0 deletions tlrc/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/sh
set -e
set -u

__init_tlrc() {

###############
# Install tlrc #
###############

# Every package should define these 6 variables
pkg_cmd_name="tlrc"

pkg_dst_cmd="$HOME/.local/bin/tlrc"
pkg_dst="$pkg_dst_cmd"

pkg_src_cmd="$HOME/.local/opt/tlrc-v$WEBI_VERSION/tlrc"
pkg_src_dir="$HOME/.local/opt/tlrc-v$WEBI_VERSION"
pkg_src="$pkg_src_cmd"

# pkg_install must be defined by every package
pkg_install() {
# ~/.local/opt/tlrc-v1.11.1/
mkdir -p "$(dirname "${pkg_src_cmd}")"

# mv ./tlrc ~/.local/opt/tlrc-v1.11.1/tlrc
mv ./tlrc "${pkg_src_cmd}"
}

# pkg_get_current_version is recommended, but not required
pkg_get_current_version() {
# 'tlrc --version' has output in this format:
# tlrc 1.11.1
# This trims it down to just the version number:
# 1.11.1
tlrc --version 2> /dev/null |
head -n 1 |
cut -d ' ' -f 2
}

}

__init_tlrc
19 changes: 19 additions & 0 deletions tlrc/releases.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use strict';

var github = require('../_common/github.js');
var owner = 'tldr-pages';
var repo = 'tlrc';

module.exports = function () {
return github(null, owner, repo).then(function (all) {
// tlrc has a clean release structure, no filtering needed
return all;
});
};

if (module === require.main) {
module.exports().then(function (all) {
all = require('../_webi/normalize.js')(all);
console.info(JSON.stringify(all, null, 2));
});
}