https://github.com/jonasbn/bash_completion_historian
Experimental bash completion for historian
https://github.com/jonasbn/bash_completion_historian
bash bash-completion historian
Last synced: 4 months ago
JSON representation
Experimental bash completion for historian
- Host: GitHub
- URL: https://github.com/jonasbn/bash_completion_historian
- Owner: jonasbn
- License: mit
- Created: 2017-05-19T19:45:36.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-11T13:39:54.000Z (over 7 years ago)
- Last Synced: 2025-02-15T05:27:19.527Z (4 months ago)
- Topics: bash, bash-completion, historian
- Language: Shell
- Size: 7.81 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Historian Bash Completion
Incredibly basic `bash` completion for [**historian**](https://github.com/jcsalterego/historian).
[](https://opensource.org/licenses/MIT)
## Usage
```
$ hist
config count import search shell version
```See [**historian**](https://github.com/jcsalterego/historian) for more information on the different commands available to `hist` (historian), can also be retrieved via `hist` without arguments.
## Download
```bash
$ curl https://raw.githubusercontent.com/jonasbn/bash_completion_historian/master/hist > hist
```## Installation
Where your completions are located might vary.
### Personal
If you want to install them for your personal use, do the following.
Create the file: `~/.bash_completion`, containing the code below:
```bash
for bcfile in ~/.bash_completion.d/* ; do
. $bcfile
done
```Ref: [ServerFault.com: _Standard place for user defined bash_completion.d scripts?_](https://serverfault.com/questions/506612/standard-place-for-user-defined-bash-completion-d-scripts)
Create a directiory for your completions:
```bash
$ mkdir ~/.bash_completion.d
```Copy your completions into the newly created directory:
```bash
$ cp hist ~/.bash_completion.d/
```Start a new shell and you should be good to go.
### System-wide example from Debian
Based on [an introduction](https://debian-administration.org/article/316/An_introduction_to_bash_completion_part_1) to `bash` completions on Debian.
```bash
$ sudo cp hist /etc/bash_completion.d/
```### System-wide example from OSX
This assumes you are using **Homebrew**
Do note that paths vary based on whether you are using `bash` 3 or 4
#### `bash` 3 (Formula: `bash-completions`):
```bash
$ cp hist /usr/local/etc/bash_completion.d/
```And to activate right away:
```bash
$ source /usr/local/etc/bash_completion.d/hist
```#### `bash` 4 (Formula: `bash-completions2`)
```bash
$ cp hist /usr/local/share/bash-completion/completions/
```And to activate right away:
```bash
$ source /usr/local/share/bash-completion/completions/hist
```## Motivation
I just fell over **historian** in a blog post on tools, playing around with it, might aswell implement a basic `bash` completion to level the learning curve (remembering stuff).
## See Also
A more elaborate piece of documentation on `bash` completions is available from **The Linux Documentation Project** in the [Advanced Bash-Scripting Guide](http://tldp.org/LDP/abs/html/tabexpansion.html).
From the [GNU Documentation](https://www.gnu.org/software/bash/manual/html_node/Programmable-Completion.html).
Good two-part article, "An Introduction to Bash Completion": [Part 1](https://debian-administration.org/article/316/An_introduction_to_bash_completion_part_1) and [Part 2](https://debian-administration.org/article/317/An_introduction_to_bash_completion_part_2).
Please note that this experimental implementation has only been tested with `bash` version 4.
The most comprehensive collection of `bash` completions I have come across is [the one](https://github.com/scop/bash-completion) from the **Debian Linux distribution**. It is also the one offered for OSX via **Homebrew**.
## License
This is made available under the MIT license, see separate license file.
## Copyright
:copyright: jonasbn 2017