67 lines
3.1 KiB
Bash
67 lines
3.1 KiB
Bash
|
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
|
||
|
|
||
|
function __esection() {
|
||
|
local -a lines
|
||
|
local lsep prefix="$(__edate)$(__eindent0)"
|
||
|
local length="${COLUMNS:-80}"
|
||
|
setx lsep=__complete "$prefix" "$length" -
|
||
|
|
||
|
tooenc "$lsep"
|
||
|
[ -n "$*" ] || return 0
|
||
|
length=$((length - 1))
|
||
|
setx -a lines=echo "$1"
|
||
|
for line in "${lines[@]}"; do
|
||
|
setx line=__complete "$prefix- $line" "$length"
|
||
|
tooenc "$line-"
|
||
|
done
|
||
|
tooenc "$lsep"
|
||
|
}
|
||
|
function __etitle() {
|
||
|
local p="TITLE: " i=" "
|
||
|
tooenc "$(__edate)$(__eindent0)${p}$(__eindent "$1" "$i")"
|
||
|
}
|
||
|
function __edesc() {
|
||
|
local p="DESC: " i=" "
|
||
|
tooenc "$(__edate)$(__eindent0)${p}$(__eindent "$1" "$i")"
|
||
|
}
|
||
|
function __ebanner() {
|
||
|
local -a lines
|
||
|
local lsep prefix="$(__edate)$(__eindent0)"
|
||
|
local length="${COLUMNS:-80}"
|
||
|
setx lsep=__complete "$prefix" "$length" =
|
||
|
|
||
|
tooenc "$lsep"
|
||
|
length=$((length - 1))
|
||
|
setx -a lines=echo "$1"
|
||
|
for line in "" "${lines[@]}" ""; do
|
||
|
setx line=__complete "$prefix= $line" "$length"
|
||
|
tooenc "$line="
|
||
|
done
|
||
|
tooenc "$lsep"
|
||
|
}
|
||
|
function __eimportant() { tooenc "$(__edate)$(__eindent0)IMPORTANT! $(__eindent "$1" " ")"; }
|
||
|
function __eattention() { tooenc "$(__edate)$(__eindent0)ATTENTION! $(__eindent "$1" " ")"; }
|
||
|
function __eerror() { tooenc "$(__edate)$(__eindent0)ERROR: $(__eindent "$1" " ")"; }
|
||
|
function __ewarn() { tooenc "$(__edate)$(__eindent0)WARNING: $(__eindent "$1" " ")"; }
|
||
|
function __enote() { tooenc "$(__edate)$(__eindent0)NOTE: $(__eindent "$1" " ")"; }
|
||
|
function __einfo() { tooenc "$(__edate)$(__eindent0)INFO: $(__eindent "$1" " ")"; }
|
||
|
function __edebug() { tooenc "$(__edate)$(__eindent0)DEBUG: $(__eindent "$1" " ")"; }
|
||
|
function __eecho() { tooenc "$(__edate)$(__eindent0)$(__eindent "$1")"; }
|
||
|
function __eecho_() { tooenc_ "$(__edate)$(__eindent0)$(__eindent "$1")"; }
|
||
|
|
||
|
function __estep() { tooenc "$(__edate)$(__eindent0). $(__eindent "$1" " ")"; }
|
||
|
function __estepe() { tooenc "$(__edate)$(__eindent0).E $(__eindent "$1" " ")"; }
|
||
|
function __estepw() { tooenc "$(__edate)$(__eindent0).W $(__eindent "$1" " ")"; }
|
||
|
function __estepn() { tooenc "$(__edate)$(__eindent0).N $(__eindent "$1" " ")"; }
|
||
|
function __estepi() { tooenc "$(__edate)$(__eindent0).I $(__eindent "$1" " ")"; }
|
||
|
function __estep_() { tooenc_ "$(__edate)$(__eindent0). $(__eindent "$1" " ")"; }
|
||
|
function __estepe_() { tooenc_ "$(__edate)$(__eindent0).E $(__eindent "$1" " ")"; }
|
||
|
function __estepw_() { tooenc_ "$(__edate)$(__eindent0).W $(__eindent "$1" " ")"; }
|
||
|
function __estepn_() { tooenc_ "$(__edate)$(__eindent0).N $(__eindent "$1" " ")"; }
|
||
|
function __estepi_() { tooenc_ "$(__edate)$(__eindent0).I $(__eindent "$1" " ")"; }
|
||
|
|
||
|
function __action() { tooenc "$(__edate)$(__eindent0)ACTION: $(__eindent "$1" " ")"; }
|
||
|
function __asuccess() { tooenc "$(__edate)$(__eindent0)(OK) $(__eindent "$1" " ")"; }
|
||
|
function __afailure() { tooenc "$(__edate)$(__eindent0)(KO) $(__eindent "$1" " ")"; }
|
||
|
function __adone() { tooenc "$(__edate)$(__eindent0)$(__eindent "$1")"; }
|