Avoid some have() calls.
Single file existence etc checks are cheaper than full $PATH lookups.
This commit is contained in:
parent
c65949385a
commit
f7c93600a6
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
# Test for existence of /etc/profile.d/modules.sh too because we may end up
|
# Test for existence of /etc/profile.d/modules.sh too because we may end up
|
||||||
# being sourced before it and thus before the `module' alias has been defined.
|
# being sourced before it and thus before the `module' alias has been defined.
|
||||||
have module || [ -f /etc/profile.d/modules.sh ] && {
|
[ -f /etc/profile.d/modules.sh ] || have module && {
|
||||||
|
|
||||||
_module_list ()
|
_module_list ()
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# bash completion for Slackware Linux pkgtools
|
# bash completion for Slackware Linux pkgtools
|
||||||
|
|
||||||
have removepkg && [ -f /etc/slackware-version ] &&
|
[ -f /etc/slackware-version ] && have removepkg &&
|
||||||
_removepkg()
|
_removepkg()
|
||||||
{
|
{
|
||||||
local packages cur
|
local packages cur
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
# 'service' command and/or the SysV init.d directory, followed by
|
# 'service' command and/or the SysV init.d directory, followed by
|
||||||
# that script's available commands
|
# that script's available commands
|
||||||
#
|
#
|
||||||
{ have service || [ -d /etc/init.d/ ]; } &&
|
[ -d /etc/init.d ] || have service &&
|
||||||
_service()
|
_service()
|
||||||
{
|
{
|
||||||
local cur prev sysvdir
|
local cur prev sysvdir
|
||||||
|
Loading…
x
Reference in New Issue
Block a user