diff --git a/README.adoc b/README.adoc index ad374a7..0c97ba8 100644 --- a/README.adoc +++ b/README.adoc @@ -1,7 +1,7 @@ [separator=—] = Bashmatic® — BASH-based DSL helpers for humans, sysadmins, and fun. // vim: ft=asciidoc -:author: Version v3.0.3 +:author: Version v3.0.5 :doctype: book :source-highlighter: rouge :rouge-style: base16.monokai diff --git a/README.pdf b/README.pdf index 62fc950..3a1c497 100644 Binary files a/README.pdf and b/README.pdf differ diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index 88b9b6b..7dcb5c6 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [v3.0.5](https://github.com/kigster/bashmatic/tree/v3.0.5) (2022-10-11) + +[Full Changelog](https://github.com/kigster/bashmatic/compare/v3.0.4...v3.0.5) + ## [v3.0.4](https://github.com/kigster/bashmatic/tree/v3.0.4) (2022-10-03) [Full Changelog](https://github.com/kigster/bashmatic/compare/v3.0.3...v3.0.4) diff --git a/doc/FUNCTIONS.adoc b/doc/FUNCTIONS.adoc index 1a5b3ea..1443e3b 100644 --- a/doc/FUNCTIONS.adoc +++ b/doc/FUNCTIONS.adoc @@ -15,7 +15,6 @@ * xref:#module-asciidoc[asciidoc] * xref:#module-audio[audio] * xref:#module-aws[aws] -* xref:#module-background[background] * xref:#module-bashit[bashit] * xref:#module-bashmatic[bashmatic] * xref:#module-brew[brew] @@ -913,70 +912,6 @@ aws.s3.upload () ---- -=== Module `background` - -==== `background.log` - -[source,bash] ----- -background.log () -{ - local index="${1:-0}" - printf "${background_log/{{index}}/${index}}" -} - ----- - -==== `background.run` - -[source,bash] ----- -background.run () -{ - for command in "$@" - do - local index=${#running_jobs[@]} - local log="$(background.log "${index}")" - ( ${command} 2>&1 | tee -a "${log}" ) & running_jobs[$!]=-1 - done -} - ----- - -==== `background.sigchld` - -[source,bash] ----- -background.sigchld () -{ - for pid in "${!running_jobs[@]}" - do - if [ ! -d "/proc/$pid" ]; then - wait "${pid}" - local code="$?" - running_jobs["${pid}"]=${code} - fi - done -} - ----- - -==== `background.wait` - -[source,bash] ----- -background.wait () -{ - local timeout - echo Starting background processes with pidS ${!pidS[@]} - echo Starting dd - timeout 15s dd if=/dev/zero of=/dev/null - echo dd terminated -} - ----- - - === Module `bashit` ==== `bashit-activate` @@ -7382,6 +7317,28 @@ hr.colored () ---- +==== `inline.not-ok` + +[source,bash] +---- +inline.not-ok () +{ + printf " ${txtwht}${bakred} ✘ ${clr} " +} + +---- + +==== `inline.ok` + +[source,bash] +---- +inline.ok () +{ + printf " ${txtblk}${bakgrn} ✔︎ ${clr} " +} + +---- + ==== `left` [source,bash] @@ -7587,6 +7544,46 @@ output.reset-min-max-width () ---- +==== `output.screen-height.actual` + +[source,bash] +---- +output.screen-height.actual () +{ + local h + util.os + if [[ ${AppCurrentOS} =~ darwin ]]; then + h="$(.output.stty.field rows)" + else + if [[ ${AppCurrentOS} =~ linux ]]; then + h="$(stty -a 2>/dev/null | grep rows | awk '{print $5}' | sedx 's/;//g')" + fi + fi + printf -- "%d" "$h" +} + +---- + +==== `output.screen-width.actual` + +[source,bash] +---- +output.screen-width.actual () +{ + local w + util.os + if [[ ${AppCurrentOS} =~ darwin ]]; then + w="$(.output.stty.field columns)" + else + if [[ ${AppCurrentOS} =~ linux ]]; then + w="$(stty -a 2>/dev/null | grep columns | awk '{print $7}' | sedx 's/;//g')" + fi + fi + printf -- "%d" "$w" +} + +---- + ==== `output.set-max-width` [source,bash] @@ -7654,6 +7651,17 @@ screen.height () ---- +==== `screen.height.actual` + +[source,bash] +---- +screen.height.actual () +{ + .output.screen-height +} + +---- + ==== `screen.width` [source,bash] diff --git a/doc/USAGE.pdf b/doc/USAGE.pdf index 190d158..4e67416 100644 Binary files a/doc/USAGE.pdf and b/doc/USAGE.pdf differ