about summary refs log tree commit diff stats
path: root/wrap
diff options
context:
space:
mode:
authorCase Duckworth2020-05-22 15:55:03 -0500
committerCase Duckworth2020-05-22 15:55:03 -0500
commit5ff9d1c592511270abe871915aa0716cec1e6eac (patch)
tree409d23f3690a414b64995e85d6891684e0824104 /wrap
parentIt works! (diff)
downloadbollux-5ff9d1c592511270abe871915aa0716cec1e6eac.tar.gz
bollux-5ff9d1c592511270abe871915aa0716cec1e6eac.zip
Remove unneeded stuff
Diffstat (limited to 'wrap')
-rwxr-xr-xwrap31
1 files changed, 0 insertions, 31 deletions
diff --git a/wrap b/wrap deleted file mode 100755 index 011aa58..0000000 --- a/wrap +++ /dev/null
@@ -1,31 +0,0 @@
1#!/usr/bin/env bash
2
3wrap() {
4 local width="$1"
5 local len=0
6
7 while read -r -a line; do
8 for word in "${line[@]}"; do
9 ((len += "${#word}" + 1))
10 #printf '%s' "$len"
11 if ((len >= width)); then
12 printf '\n'
13 # ruler "$width"
14 len=${#word}
15 fi
16 printf '%s ' "$word"
17 done
18 done
19 printf '\n'
20}
21
22ruler() {
23 for ((i = 0; i < $1; i++)); do
24 printf '%s' "${2:--}"
25 done
26 printf '\n'
27}
28
29if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then
30 wrap "$@"
31fi