This file contains some very basic functions that are wildely used. Since bash is pain to read, you better do a lot of them.
### yell
Print its arguments on stderr.
### die
Like yell but clean and exit too.
### root_or_die
Execute `die` if the user is not root
### clean
Store its last argument as command and execute them all when called without arguments. Example:
```
$ clean "echo file"
$ clean
file
```
You can add a first argument in (pre/post/del) to add your command before/after the others or to remove it from the list
Clean is automatically called on SIGINT and by `die`. You should call it at your scripts end to handle the cleaning.
### section
Print a separation line that is the size of the terminal. If an argument is provided, it will be displayed in the middle of the line.
```
$ section 'Unit tests'
====================================== Unit tests ======================================
```
### run
Execute a command. Run a clean and exit if it returns a non zero status.
If you set the variable `driglibash_run_retry`, you will be asked to retry a failing command.
### start
Execute a command in background, add a clean task that kill it, and returns the pid.
Be careful ! Only the PID of the started process is returned. If the process forks, driglibash can’t stop it when needed.
### where
Tells you where (in absolute path) is the script being executed. Useful when you want to access som files next to your executable. If the `--follow` argument is provided, `where` will follow symlinks and find the linked script file.
MUSTBERUNBEFOREANY `cd`
### repeat
Print its first argument, the second argument times.
```
$ repeat '=' 10
==========
```
## driglibash-args
A little framework for argument parsing in bash. It already contains driglibash-base.
Just fill the arrays `usage` et `varia` and the value