From c57877f92e34c778f5527838b9b9abb00b6428de Mon Sep 17 00:00:00 2001 From: ianmacd <> Date: Sat, 7 Jun 2003 20:59:37 +0000 Subject: [PATCH] - make ifconfig completion work on FreeBSD, too --- bash_completion | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bash_completion b/bash_completion index 0000d0a2..e8128666 100644 --- a/bash_completion +++ b/bash_completion @@ -1,6 +1,6 @@ # bash_completion - some programmable completion functions for bash 2.05b # -# $Id: bash_completion,v 1.575 2003/06/07 22:46:04 ianmacd Exp $ +# $Id: bash_completion,v 1.576 2003/06/07 22:59:37 ianmacd Exp $ # # Copyright (C) Ian Macdonald # @@ -213,7 +213,7 @@ _pgids() # Linux ifconfig(8) and iwconfig(8) helper function # -[ $UNAME = Linux ] && { have ifconfig || have iwconfig; } && +[ $UNAME = Linux -o $UNAME = FreeBSD ] && { have ifconfig || have iwconfig; } && _ifwconfig() { COMPREPLY=() @@ -240,7 +240,8 @@ _ifwconfig() esac COMPREPLY=( $( eval "$@" 2>/dev/null | \ - sed -ne 's|^\('$cur'[^ ]*\).*$|\1|p' ) ) + sed -ne + 's|^\('$cur'[^[:space:][:punct:]]\{1,\}\).*$|\1|p') ) } # start of section containing completion functions for bash built-ins @@ -817,7 +818,7 @@ complete -F _find $filenames find # Linux ifconfig(8) completion # -[ $UNAME = Linux ] && have ifconfig && +[ $UNAME = Linux -o $UNAME = FreeBSD ] && have ifconfig && _ifconfig() { local cur @@ -829,7 +830,8 @@ _ifconfig() COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- $cur ) ) } -[ $UNAME = Linux ] && have ifconfig && complete -F _ifconfig ifconfig +[ $UNAME = Linux -o $UNAME = FreeBSD ] && have ifconfig && + complete -F _ifconfig ifconfig # Linux iwconfig(8) completion #