dot

packages and services management
Log | Files | Refs | README

commit b5315c07b37edad0f7f9190150e7e13940048915
parent 1d1feed3bdff3520f49bcef69950a3d50b578374
Author: Josuah Demangeon <mail@josuah.net>
Date:   Thu, 23 Nov 2017 21:41:10 +0100

twt: more corectness

Diffstat:
Mbin/twt | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git a/bin/twt b/bin/twt @@ -102,6 +102,7 @@ touch "$CONF" case "$1" in (tweet) [ $# -ne 2 ] && exec "$0" + msg=$(printf %s "$2" | sed 's|[^ ]*://[^ ]*|@<&>|' | tr '\n' ' ') while read -r usr url do @@ -116,11 +117,13 @@ case "$1" in (view) [ $# -ne 2 ] && exec "$0" [ -f "$CACHE/$2" ] || err "$2 feed not found, try update" + awk "$awk_line" "$CACHE/$2" | sort -r | awk "$awk_show" | $PAGER ;; (timeline) [ $# -ne 1 ] && exec "$0" ls "$CACHE"/* 2> /dev/null 1>&2 || err 'no feed found, try to update' + awk "$awk_line" "$CACHE"/* | sort -r | awk "$awk_show" | $PAGER ;; (update) @@ -131,8 +134,10 @@ case "$1" in ;; (follow) [ $# -ne 3 ] && exec "$0" + sed 's/[[:space:]].*//' "$CONF" | grep -Fqx "$2" && err "already following $2" + printf '%s\t%s\n' "$2" "$3" >> "$CONF" sort -uo "$CONF" "$CONF" ;; @@ -140,11 +145,13 @@ case "$1" in [ $# -ne 2 ] && exec "$0" sed 's/[[:space:]].*//' "$CONF" | grep -Fqx "$2" || err "not following $2" + sed "/^$(printf %s "$2" | sed 's/./[&]/g')[[:space:]]/ d" "$CONF" | sort -uo "$CONF" ;; (following) [ $# -ne 1 ] && exec "$0" + sed -re's/[[:space:]]/ /' -e's/(.{12}[^ ]*) */\1 @ /' "$CONF" ;; (*)