-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxhr
More file actions
executable file
·58 lines (52 loc) · 1.6 KB
/
xhr
File metadata and controls
executable file
·58 lines (52 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env bash
#
# ############################################################################
# Project: scripts (none)
# File...: xhr
# Created: Wednesday, 2021/05/26 - 23:45:50
# Author.: @fbnmtz, (fabiano.matoz@gmail.com)
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~~·~·~·~·~·~·~·~
# Last Modified: Thursday, 2025/02/20 - 00:31:37
# Modified By..: @fbnmtz, (fabiano.matoz@gmail.com)
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~~·~·~·~·~·~·~·~
# Version: 0.1.6.103
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~~·~·~·~·~·~·~·~
# Description:
# >
# ############################################################################
# HISTORY:
#
#
# shellcheck disable=SC1090
source "$xSHELL_INIT"
use args colors
xrequirements tput seq
xarg --id -c,--char --var "char+r" --desc "custom <char> for header"
xarg --id -s,--size --var "size+r" --desc "columns of header"
xarg --id -C,--comment --desc "add comment before header line"
xrun --xversionrc "$@"
if [ -z "$char" ]; then
if [ -n "$1" ]; then
case $1 in
1) char="~" ;;
2) char="*" ;;
3) char="-" ;;
4) char="+" ;;
5) char="." ;;
6) char="/" ;;
*) char="$1" ;;
esac
else
char="#"
fi
fi
# get curret terminal collumn size
[ -z "$size" ] && size=$(($(tput cols)-2))
# add shell comment before, if requested
[[ "$xarg" == *C* ]] && echo -n "# "
# print header line
for i in $(seq 1 "$size"); do
echo -n "$char"
done
# break line at end
echo