dot

packages and services management
Log | Files | Refs | README

commit 6728557423b8ecc6a691229d855296ed11e99408
parent e8dd6c29a8bfd3b8e447d35bd52aa7358c85b787
Author: Josuah Demangeon <josuah.demangeon@gandi.net>
Date:   Wed, 23 Aug 2017 18:24:45 +0200

shell/bin/txt: using leading tabs for litterals

Diffstat:
Ashell/bin/.txt.swp | 0
Mshell/bin/l | 22++++++----------------
Mshell/bin/txt | 32++++++++++++++++----------------
3 files changed, 22 insertions(+), 32 deletions(-)

diff --git a/shell/bin/.txt.swp b/shell/bin/.txt.swp Binary files differ. diff --git a/shell/bin/l b/shell/bin/l @@ -1,18 +1,8 @@ -if [ -d "${1:-.}" ] -then - cd "${1:-.}" || exit 1 +cd "${1:-.}" || exit 1 - printf '## %s/ ' "$PWD" +git status -s --branch 2> /dev/null - git status -s --branch 2> /dev/null || printf '##\n' - - { - ls -p | grep '/$' - ls -F | grep -v '/$' - } | column - -elif [ -f "$1" ] -then - $PAGER "$1" - exit 0 -fi +{ + ls -p | grep '/$' + ls -F | grep -v '/$' +} | column diff --git a/shell/bin/txt b/shell/bin/txt @@ -1,21 +1,5 @@ awk -F '\0' ' -# blanks - -/^[\t ]*$/ { - next -} - -# litterals - -/^---$/ { - print "\n" $0 - while (getline && $0 != "---") - print $0 - print - next -} - # title FNR == 1 { @@ -28,6 +12,22 @@ FNR == 1 { next } +# litterals + +/^\t/ { + print "" + do { + print + } while (getline && $0 ~ "^\t") + next +} + +# blanks + +/^[\t ]*$/ { + next +} + # heading sub("^--- +", "", $0) {