rcr – the launcher of nested scripts, named in command line.

Required

Python-2.7

For developers

To generate new html and man documentation files from Latex sources, one will need:
latex2man script
perl
devdoc command from rcr sources
To generate text files (for README) one will need:
links or other text browser with option -dump
To generate pdf output one will need:
Latex typesetting system
latex2man package

Latest release

Latest code

Description

rcr takes command line arguments and checks for each one, whether script with given name exists in special directory. That directory is calculated as ../libexec/rcr/ relative to rcr executable file.
The most nested available script is launched, and the rest arguments are passed through to it.
The directory with scripts is stored in environment variable RCR_ROOT, which rcr sets up.

Shell command below (after path substitution for rcr executable):

    $ /usr/bin/rcr sub actions with arguments
is transformed into execution of command:
    $ RCR_ROOT=/usr/libexec/rcr /usr/libexec/rcr/sub/actions with arguments

Here /usr/libexec/rcr/ is the base directory for your custom scripts.
When directory with the name of current word from command line appears, search is continued inside it for the next word. When executable script with the name of current word from command line appears, it is launched. If directory entry/ was entered, but no executable script inside matches next command word, or there is no next command word, script entry/entry is launched.
If no appropriate script was found, rcr terminates with diagnostics.

Script, used as command, must have executable permissions and the interpretator name in the first string (for example, #!/bin/sh).

Install

Default install resides in $HOME/rrr/.
    $ ./install.sh

Layout of default install:

$HOME/rrr/bin/rcr
The main executable.
$HOME/rrr/libexec/rcr/
Directory to keep your custom commands.
$HOME/rrr/etc/bash_completion.d/rcr.sh
auto-completion support for your custom rcr commands in bash shell.
$HOME/rrr/share/doc/rcr/
Descriptions of the package in html format.
$HOME/rrr/share/man/
Manual pages for the package, same info as in html.

You would probably want to add path $HOME/rrr/bin/ to your default PATH in $HOME/.profile or $HOME/.bashrc.

To turn auto-completion for rcr commands by default for all new shell sessions, add to your $HOME/.bashrc:

    $ . ~/rrr/etc/bash_completion.d/rcr.sh

Variable DESTDIR is used to keep the path to the root install destination. Its default value is:

    $ DESTDIR=$HOME/rrr ./install.sh
PREFIX is also supported, though its value can be appended directly to DESTDIR.

To install whole rcr somewhere system-wide:

    $ sudo env DESTDIR=/usr/poligon ./install.sh
Use direct system-wide installation only to empty separated DESTDIR. To integrate the material into working system use packages and installation methods of your OS.

Distribution

Available under ISC License.
Copyright 2012-2017 Random Crew.