summaryrefslogtreecommitdiff
path: root/bash_completion
diff options
context:
space:
mode:
authorVille Skyttä <ville.skytta@iki.fi>2011-10-16 10:56:44 +0300
committerVille Skyttä <ville.skytta@iki.fi>2011-10-16 10:56:44 +0300
commit5afc526850c28ad51ade1ec773ede268157b33bd (patch)
treea53e74aa4f22010784fd492ec6300093aacd3684 /bash_completion
parent4e5a67cfaf95dc78d85a896b3dee7cd5c4d5c937 (diff)
downloadbash-completion-5afc526850c28ad51ade1ec773ede268157b33bd.tar.gz
Make _userland easier to use.
Diffstat (limited to 'bash_completion')
-rw-r--r--bash_completion11
1 files changed, 5 insertions, 6 deletions
diff --git a/bash_completion b/bash_completion
index f01b3a75..4bfa4de8 100644
--- a/bash_completion
+++ b/bash_completion
@@ -92,14 +92,13 @@ complete -b builtin
# start of section containing completion functions called by other functions
-# Output what userland we're running on
+# Check if we're running on the given userland
+# @param $1 userland to check for
_userland()
{
- local uname=$( uname -s )
- case $uname in
- Linux|GNU|GNU/*) echo GNU ;;
- *) echo "$uname" ;;
- esac
+ local userland=$( uname -s )
+ [[ $userland == @(Linux|GNU/*) ]] && userland=GNU
+ [[ $userland == $1 ]]
}
# This function checks whether we have a given program on the system.