mirror of
https://github.com/mjsarfatti/beddu.git
synced 2025-06-27 01:18:01 +02:00
Add upclear utility
This commit is contained in:
parent
76d136f64c
commit
24633a743e
14 changed files with 42 additions and 56 deletions
|
@ -1,13 +1,13 @@
|
|||
#! /usr/bin/env bash
|
||||
#!/usr/bin/env bash
|
||||
# @private
|
||||
|
||||
_q='?'
|
||||
_a='❯'
|
||||
_o='◌'
|
||||
_O='●'
|
||||
_mark='✓'
|
||||
_warn='!'
|
||||
_cross='✗'
|
||||
_spinner='⣷⣯⣟⡿⢿⣻⣽⣾' # See for alternatives: https://antofthy.gitlab.io/info/ascii/Spinners.txt
|
||||
readonly _q='?'
|
||||
readonly _a='❯'
|
||||
readonly _o='◌'
|
||||
readonly _O='●'
|
||||
readonly _mark='✓'
|
||||
readonly _warn='!'
|
||||
readonly _cross='✗'
|
||||
readonly _spinner='⣷⣯⣟⡿⢿⣻⣽⣾' # See for alternatives: https://antofthy.gitlab.io/info/ascii/Spinners.txt
|
||||
|
||||
export _q _a _o _O _mark _warn _cross _spinner
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#! /usr/bin/env bash
|
||||
#!/usr/bin/env bash
|
||||
# movements.sh - Cursor helper functions
|
||||
|
||||
# Move cursor up one line
|
||||
|
@ -28,9 +28,7 @@ cl() {
|
|||
|
||||
# Clear line above
|
||||
upclear() {
|
||||
up
|
||||
bol
|
||||
cl
|
||||
up; bol; cl
|
||||
}
|
||||
|
||||
# Print a single newline
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#! /usr/bin/env bash
|
||||
#!/usr/bin/env bash
|
||||
# pen.sh - Print pretty text
|
||||
|
||||
# @depends on:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#! /usr/bin/env bash
|
||||
#!/usr/bin/env bash
|
||||
# run.sh - Execute commands with output/error capture
|
||||
|
||||
# Execute a command with stdout and stderr capture capabilities
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#! /usr/bin/env bash
|
||||
#!/usr/bin/env bash
|
||||
# check.sh - Print a success message
|
||||
|
||||
# @depends on:
|
||||
|
@ -25,9 +25,7 @@ check() {
|
|||
# If there is a spinner running, stop it and clear the line
|
||||
if spinning; then
|
||||
spop
|
||||
up
|
||||
bol
|
||||
cl
|
||||
upclear
|
||||
fi
|
||||
|
||||
pen -n green "${_mark:-✓} "
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#! /usr/bin/env bash
|
||||
#!/usr/bin/env bash
|
||||
# repen.sh - Overwrite the previous line with new text
|
||||
|
||||
# @depends on:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#! /usr/bin/env bash
|
||||
#!/usr/bin/env bash
|
||||
# spin.sh - Print a spinner with a message
|
||||
|
||||
# @depends on:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#! /usr/bin/env bash
|
||||
#!/usr/bin/env bash
|
||||
# throw.sh - Print an throw message
|
||||
|
||||
# @depends on:
|
||||
|
@ -25,9 +25,7 @@ throw() {
|
|||
# If there is a spinner running, stop it and clear the line
|
||||
if spinning; then
|
||||
spop
|
||||
up
|
||||
bol
|
||||
cl
|
||||
upclear
|
||||
fi
|
||||
|
||||
pen -n red "${_cross:-✗} "
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#! /usr/bin/env bash
|
||||
#!/usr/bin/env bash
|
||||
# warn.sh - Print a warning message
|
||||
|
||||
# @depends on:
|
||||
|
@ -25,9 +25,7 @@ warn() {
|
|||
# If there is a spinner running, stop it and clear the line
|
||||
if spinning; then
|
||||
spop
|
||||
up
|
||||
bol
|
||||
cl
|
||||
upclear
|
||||
fi
|
||||
|
||||
pen -n yellow bold italic "${_warn:-!} "
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#! /usr/bin/env bash
|
||||
#!/usr/bin/env bash
|
||||
# ask.sh - Get free text input from the user
|
||||
|
||||
# @depends on:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#! /usr/bin/env bash
|
||||
#!/usr/bin/env bash
|
||||
# choose.sh - Choose from a menu of options
|
||||
|
||||
# @depends on:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#! /usr/bin/env bash
|
||||
#!/usr/bin/env bash
|
||||
# confirm.sh - Read a yes/no confirmation from the user
|
||||
|
||||
# @depends on:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue