We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 50b0adc commit 3f09407Copy full SHA for 3f09407
opt/cs50/lib/cli
@@ -16,7 +16,7 @@ function _ansi() {
16
# Format backticks as bold
17
local bold=$(printf '\033[1m')
18
local normal=$(printf '\033[22m')
19
- echo "$input" | sed "s/\`\\([^\`]*\\)\`/${bold}\\1${normal}/g"
+ echo "$input" | sed "s/\`\\([^\`]*\\)\`/${bold}\\1${normal}/g" | _fold
20
}
21
22
function _find() {
@@ -46,6 +46,22 @@ function _find() {
46
fi
47
48
49
+function _fold() {
50
+
51
+ # If command-line arguments
52
+ if [[ -t 0 ]]; then
53
+ input="$*"
54
55
+ # If standard input
56
+ else
57
+ input=$(cat)
58
+ fi
59
60
+ # Wrap long lines
61
+ local cols=$(tput cols)
62
+ echo "$input" | fold --spaces --width=$cols
63
+}
64
65
function _sure() {
66
if [[ $# -ne 1 ]]; then
67
return 1
0 commit comments