~dricottone/my-utils

6f0bf4a305d99569b0c27242bf6a5469d5ab5b43 — Dominic Ricottone 2 years ago 63ec1cb
whichcat now respects the quiet option
1 files changed, 3 insertions(+), 5 deletions(-)

M core/whichcat
M core/whichcat => core/whichcat +3 -5
@@ 1,7 1,7 @@
#!/bin/sh

name="whichcat"
version="1.0"
version="1.1"
help_message=$(/usr/bin/cat <<-EOF
	Print all lines from a program to the terminal
	Usage: whichcat [PROGRAM ..] [OPTIONS]


@@ 14,16 14,15 @@ EOF

. /usr/local/lib/myminiparse.sh

# loop through input
code=0
quiet=0
for arg; do
  case "$arg" in
  -q|--quiet)
    #ignore these
    quiet=1
    ;;

  *)
    # main routine
    target=$(command -v "$arg")
    if [ -z "$target" ]; then
      if [ "$quiet" -eq 0 ]; then


@@ 37,6 36,5 @@ for arg; do
  esac
done

# return stored code
exit "$code"