GithubHelp home page GithubHelp logo

summer20100514 / tldr-sh-client Goto Github PK

View Code? Open in Web Editor NEW

This project forked from raylee/tldr-sh-client

0.0 1.0 0.0 1.32 MB

Simplified and community-driven man pages

Home Page: http://tldr-pages.github.io/

License: MIT License

Shell 100.00%

tldr-sh-client's Introduction

tldr

A fully-functional POSIX shell client for tldr-pages. This version aims to be the easiest, smallest, and most universal client to set up on a new account, without sacrificing any features. It uses only /bin/sh features and curl, and tested on Linux, OSX, FreeBSD, with bash, sh, dash, ksh, zsh, csh.

tldr screenshot

Installation

mkdir -p ~/bin
curl -o ~/bin/tldr https://raw.githubusercontent.com/raylee/tldr/master/tldr
chmod +x ~/bin/tldr

Then try using the command! If you get an error such as -bash: tldr: command not found, you may need to add ~/bin to your $PATH. On OSX edit ~/.bash_profile (~/.bashrc on Linux), and add the following line to the bottom of the file:

export PATH=$PATH:~/bin

If you'd like to enable shell completion (eg. tldr w<tab><tab> to get a list of all commands which start with w) then add the following to the same startup script:

complete -W "$(tldr 2>/dev/null --list)" tldr

Prerequisites

curl needs to be available somewhere in your $PATH. The script is otherwise self-contained.

Usage

tldr [options] command

[options]
	-l, --list:      show all available pages
	-p, --platform:  show page from specific platform rather than autodetecting
	-u, --update:    update, force retrieving latest copies of index and <command>
	-h, -?, --help:  this help overview

command
	Show examples for this command

The client caches a copy of all pages and the index locally under ~/.config/tldr. By default, the cached copies will automatically update every 14 days.

Customization

You can change the styling of the output from tldr by defining some environment variables. For example, try adding the following lines to your ~/.bash_profile file (OSX) or ~/.bashrc file (Linux).

export TLDR_HEADER='magenta bold underline'
export TLDR_QUOTE='italic'
export TLDR_DESCRIPTION='green'
export TLDR_CODE='red'
export TLDR_PARAM='blue'

Possible settings are: black, red, green, yellow, blue, magenta, cyan, white, onblue, ongrey, reset, bold, underline, italic, eitalic, default (some variables may not work in some shells).

NB: You will need to log into a new session to see the effect. Just run the commands in the terminal directly to see the change immediately and temporarily.

Contributing

This is the result of a Sunday afternoon project. It's been lightly tested under Mac OS X 10.9 and Ubuntu Linux 15.10. I've tried to make the project as portable as possible, but if there's something I missed I'd love your help.

  • Want a new feature? Feel free to file an issue for a feature request.
  • Find a bug? Open an issue please, or even better send me a pull request.

Contributions are always welcome at any time!

tldr-sh-client's People

Contributors

raylee avatar ewels avatar 85pando avatar dubek avatar flipb avatar igorshubovych avatar pspeter avatar razvanstef avatar sethwoodworth avatar becomesaflame avatar bl-ue avatar v-vmikheev avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.