From 926fa4e0a8047a874fb45943fbf17bcdde80e1cf Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 7 Dec 2016 14:46:38 +1300 Subject: Prevent getopts call in tree() panicking --- sh/shrc.d/tree.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sh/shrc.d/tree.sh b/sh/shrc.d/tree.sh index dd78f8ee..b4f91df8 100644 --- a/sh/shrc.d/tree.sh +++ b/sh/shrc.d/tree.sh @@ -7,7 +7,8 @@ tree() { if ( # Not if -n is in the arguments and -C isn't - while getopts 'nC' opt ; do + # Don't tell me about missing options, either + while getopts 'nC' opt 2>/dev/null ; do case $opt in n) n=1 ;; C) C=1 ;; -- cgit v1.2.3