dot

packages and services management
Log | Files | Refs | README

commit 904d0f1890cdc7ed093dd1cbc4c626ca8c29fa58
parent 8967b380a07fcf6a58c3822761b1f72c75f5b9c7
Author: Josuah Demangeonā  ā µ <mail@josuah.net>
Date:   Wed, 15 Mar 2017 23:25:09 +0100

adding ed-title

Diffstat:
Abin/ed-title | 15+++++++++++++++
1 file changed, 15 insertions(+), 0 deletions(-)

diff --git a/bin/ed-title b/bin/ed-title @@ -0,0 +1,15 @@ +# print a header formatted as a comment string + +case "$1" in +( c ) start='/*' stop='*/' ;; +( * | '' ) start='# ' stop='' ;; +esac + +printf '%s--- %s ' "$start" "$2" + +for i in $(seq $((80 - ${#start} - ${#2} - ${#stop} - 5))) +do + printf %s '-' +done + +printf '%s\n' "$stop"