config

OpenBSD system configuration
git clone git://jacobedwards.org/config
Log | Files | Refs | README

commit fb9a807806fdd7ca81d5640f940b1b2aa81dec70
parent 7f869803fe66f3316bcfcbc4284e19426cdd6891
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date:   Mon, 15 Feb 2021 17:59:15 -0800

Restyle and default to the view command in the feed script

Defaulting to the view command is logical, simpler, and more useful
than an error message. The case statement is no longer indented
like C-style switch statements.

Diffstat:
Mmodules/scripts/.local/bin/feed | 15+++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/modules/scripts/.local/bin/feed b/modules/scripts/.local/bin/feed @@ -7,7 +7,7 @@ # l[ist] List items # i[tem] Display the nth item # e[xpr] Display items matching an ERE -# v[iew] Display all items +# v[iew] Display all items (default) view() { @@ -35,11 +35,10 @@ expr() egrep -i "$@" | view } -case $1 -in - l|list) shift; list "$@";; - i|item) shift; item "$@";; - e|expr) shift; expr "$@";; - v|view) shift; view "$@";; - *) printf 'usage: %s [command] [arg...]\n' `basename $0` 1>&2; exit 1;; +case "$1" in +(l|list) shift; list "$@";; +(i|item) shift; item "$@";; +(e|expr) shift; expr "$@";; +(v|view) shift; view "$@";; +(*) view "$@";; esac