Merge branch 'master' of https://github.com/pyr0ball/PRbL
This commit is contained in:
commit
e422b221fb
2 changed files with 28 additions and 2 deletions
24
demo.sh
24
demo.sh
|
|
@ -1,12 +1,20 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Initial Vars
|
# Initial Vars
|
||||||
VERSION=1.1.0
|
VERSION=1.2.1
|
||||||
scriptname="${BASH_SOURCE[0]##*/}"
|
scriptname="${BASH_SOURCE[0]##*/}"
|
||||||
rundir="${BASH_SOURCE[0]%/*}"
|
rundir="${BASH_SOURCE[0]%/*}"
|
||||||
runuser="$(whoami)"
|
runuser="$(whoami)"
|
||||||
|
|
||||||
source ${rundir}/functions
|
if [ ! -z $prbl_functions ] ; then
|
||||||
|
source $prbl_functions
|
||||||
|
else
|
||||||
|
if [ -f ${rundir}/functions ] ; then
|
||||||
|
source ${rundir}/functions
|
||||||
|
else
|
||||||
|
source <(curl -ks 'https://raw.githubusercontent.com/pyr0ball/PRbL/master/functions')
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Title
|
# Title
|
||||||
clear
|
clear
|
||||||
|
|
@ -61,6 +69,16 @@ boxborder "Single Character"
|
||||||
box-norm
|
box-norm
|
||||||
boxborder "Normal"
|
boxborder "Normal"
|
||||||
|
|
||||||
|
# Demo formatting transformations
|
||||||
|
|
||||||
|
# Center justified text:
|
||||||
|
|
||||||
|
center "${lyl}Center-Justified Text${dfl}"
|
||||||
|
|
||||||
|
# Spanner text
|
||||||
|
|
||||||
|
spanner "Spanner text" "end of line"
|
||||||
|
|
||||||
# Demo interactive menus
|
# Demo interactive menus
|
||||||
boxborder \
|
boxborder \
|
||||||
"${lyl}Keyboard Interactive Menus${dfl}"\
|
"${lyl}Keyboard Interactive Menus${dfl}"\
|
||||||
|
|
@ -71,6 +89,7 @@ boxborder \
|
||||||
#boxborder
|
#boxborder
|
||||||
|
|
||||||
# Example for select_option
|
# Example for select_option
|
||||||
|
|
||||||
echo "Select one option using up/down keys and enter to confirm:"
|
echo "Select one option using up/down keys and enter to confirm:"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
|
@ -83,6 +102,7 @@ echo "Choosen index = $choice"
|
||||||
echo " value = ${options[$choice]}"
|
echo " value = ${options[$choice]}"
|
||||||
|
|
||||||
# Examples for select_opt
|
# Examples for select_opt
|
||||||
|
|
||||||
case `select_opt "Yes" "No" "Cancel"` in
|
case `select_opt "Yes" "No" "Cancel"` in
|
||||||
0) echo "selected Yes";;
|
0) echo "selected Yes";;
|
||||||
1) echo "selected No";;
|
1) echo "selected No";;
|
||||||
|
|
|
||||||
|
|
@ -540,6 +540,7 @@ clone-repo(){
|
||||||
run git clone --recurse-submodules $_url $_destination
|
run git clone --recurse-submodules $_url $_destination
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
# Executes: grep "$1" | grep "$2" | grep "$3" | ...
|
# Executes: grep "$1" | grep "$2" | grep "$3" | ...
|
||||||
chained-grep(){
|
chained-grep(){
|
||||||
local pattern="$1"
|
local pattern="$1"
|
||||||
|
|
@ -561,6 +562,8 @@ trim() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Retrieve and run a script from url
|
# Retrieve and run a script from url
|
||||||
|
=======
|
||||||
|
>>>>>>> 6ffd9c2624df4c2faacda4d77f33cc9ebb17fae5
|
||||||
run-from-url(){
|
run-from-url(){
|
||||||
url=$1
|
url=$1
|
||||||
args=${*:2}
|
args=${*:2}
|
||||||
|
|
@ -583,7 +586,10 @@ run-from-url(){
|
||||||
return $ec
|
return $ec
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
# fancy script exits
|
# fancy script exits
|
||||||
|
=======
|
||||||
|
>>>>>>> 6ffd9c2624df4c2faacda4d77f33cc9ebb17fae5
|
||||||
ctrl_c(){
|
ctrl_c(){
|
||||||
echo -e "\n"
|
echo -e "\n"
|
||||||
fail "User interrupted with Ctrl-C"
|
fail "User interrupted with Ctrl-C"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue