Skip to content

Check that ruptime is present before calling #390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions bash_completion
Original file line number Diff line number Diff line change
Expand Up @@ -1685,9 +1685,11 @@ _known_hosts_real()
fi

# Add hosts reported by ruptime.
COMPREPLY+=( $(compgen -W \
"$(ruptime 2>/dev/null | awk '!/^ruptime:/ { print $1 }')" \
-- "$cur") )
if type ruptime &>/dev/null; then
COMPREPLY+=( $(compgen -W \
"$(ruptime 2>/dev/null | awk '!/^ruptime:/ { print $1 }')" \
-- "$cur") )
fi

# Add results of normal hostname completion, unless
# `COMP_KNOWN_HOSTS_WITH_HOSTFILE' is set to an empty value.
Expand Down