Tranform byobu-status --detail to use vim's folding feature

* byobu-status: output text compatible with vim's folding feature


Signed-off-by: Dustin Kirkland <kirkland@canonical.com>
This commit is contained in:
Dustin Kirkland 2009-05-06 21:02:02 -05:00
commit a5fe5a84df
2 changed files with 34 additions and 14 deletions

View file

@ -37,10 +37,6 @@ else
fi
P="$1"
B='\033[34;1m'
W='\033[47m'
X='\033[0m'
HR=" "
case "$P" in
# default = on, user must override to turn off
@ -52,16 +48,19 @@ case "$P" in
grep -qs -m1 "^$P=1$" "$HOME/.$PKG/status" || exit 0
;;
--detail)
printf "\033[1m"
[ -x "/usr/bin/dpkg-query" ] && /usr/bin/dpkg-query --show $PKG | awk '{print "# $PKG (" $2 ") detailed status:"}'
printf "$X\n"
if [ -x "/usr/bin/dpkg-query" ]; then
/usr/bin/dpkg-query --show $PKG | awk '{print $1 "-" $2 " detailed status:"}'
else
printf "$PKG detailed status:"
fi
printf "\n"
for i in `ls "$DIR"`; do
[ "$i" = "menu" ] && continue
printf "\n$W%s$X\n" "$HR"
printf "$W $X $B# %s:$X\n" "$i"
out=`"$DIR"/$i --detail | sed 's/^/\\\033[47m \\\033[0m /g'` || true
printf "$out\n"
printf "$W%s$X\n\n" "$HR"
short=`"$DIR"/$i --short | sed 's/ $//' | sed 's/.{[^}]*}//g' | sed 's/^/\t/g'` || true
detail=`"$DIR"/$i --detail | sed '/^$/d' | sed 's/^/\t/g'` || true
printf "%-20s - %s\n" "$i" "$short"
[ -n "$short" ] && printf "%s\n" "$short"
[ -n "$detail" ] && printf "%s\n" "$detail"
done
exit 0
;;

25
debian/changelog vendored
View file

@ -1,8 +1,29 @@
byobu (2.1) jaunty; urgency=low
byobu (2.1) unreleased; urgency=low
* byobu-export: touch an empty .byobu/profile, silence error message
-- Dustin Kirkland <kirkland@ubuntu.com> Wed, 06 May 2009 15:33:47 -0500
Tranform byobu-status --detail to use vim's folding feature
* byobu-status: output text compatible with vim's folding feature
* byobu-status-detail: use vim's folding status feature to allow
for collapsing/expanding each status item; fall back on
sensible-pager if +folding is not available; and fall back on less
if sensible-pager is not available
* bin/cpu-count: nothing to print on --detail
* bin/date: add --short which actually prints the current date
* bin/ec2-cost: handle on/off configuration like *all* other status
scripts, no need for FORCE
* bin/ip-address: --detail shows all inet addr's in ifconfig
* bin/logo: --detail should be empty
* bin/network-down, bin/network-up: trim leading and trailing whitespace
* bin/reboot-required: add a --short option, which prints Yes or No
* bin/time: add --short which actually prints the current time
rather than the screen escape sequence
* bin/updates-available: add a --short option, which only displays the
number of updates available; show more info on --detail about upgrades
* bin/users: grep out the grep statement in the ps
* bin/whoami: print /etc/passwd info on --detail
-- Dustin Kirkland <kirkland@ubuntu.com> Wed, 06 May 2009 21:01:56 -0500
byobu (2.0-0ubuntu1) karmic; urgency=low