aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2019-12-07 17:19:32 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2019-12-07 17:19:32 +0200
commit02c804fad43ff2b88023a58ed33c048cb646cfb8 (patch)
tree237408eff7766e896868f7dcff2952a8bc929e92
parentfa4d21193f17938b08ed23b0f6ed2805d4c46a7f (diff)
downloadopenrussian-cli-02c804fad43ff2b88023a58ed33c048cb646cfb8.tar.gz
README: document how to register short Bash aliases
-rw-r--r--README.md20
1 files changed, 20 insertions, 0 deletions
diff --git a/README.md b/README.md
index f8de0ff..01ff0c6 100644
--- a/README.md
+++ b/README.md
@@ -70,6 +70,26 @@ If it returns lots of errors, you should probably stay with the original databas
Otherwise, the error messages might help in fixing/upgrading the script.
You are of course welcome to contribute patches. :-)
+### Bash Aliases
+
+While the default command name `openrussian` was chosen to avoid cluttering the
+global command namespace, you may want to define more concise shortcuts.
+In order to do so, add something like the following to your `~/.bashrc`:
+
+ alias ru='openrussian' ру='openrussian'
+ _completion_loader openrussian
+ complete -F _openrussian_completions ru ру
+
+This adds the alias `ru` (latin) and `ру` (cyrillic).
+It would however be useful to add a few default options to the `ru` and `ру` aliases.
+Unfortunately, above method cannot take that into account.
+A more robust solution might be to install the
+[complete-alias](https://github.com/cykerway/complete-alias) script and adding
+something like the following to your `~/.bash_completion`:
+
+ alias ru='openrussian -Lde -Len' ру='openrussian -Lde -Len'
+ complete -F _complete_alias ru ру
+
## Examples
A simple lookup: