From 5494b873206ae40f58a913f100baecc8fe0fe51c Mon Sep 17 00:00:00 2001 From: ianmacd <> Date: Mon, 11 Jul 2005 22:21:13 +0000 Subject: [PATCH] ntpdate completion by Guillaume Rousse . --- bash_completion | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/bash_completion b/bash_completion index 53223d2b..3573acc3 100644 --- a/bash_completion +++ b/bash_completion @@ -1,6 +1,6 @@ # bash_completion - programmable completion functions for bash 3.0 # -# $Id: bash_completion,v 1.807 2005/07/12 00:20:16 ianmacd Exp $ +# $Id: bash_completion,v 1.808 2005/07/12 00:21:13 ianmacd Exp $ # # Copyright (C) Ian Macdonald # @@ -8135,6 +8135,37 @@ _getent() } && complete -F _getent getent +# ntpdate(1) completion +# +have ntpdate && +_ntpdate() +{ + local cur prev + + COMPREPLY=() + cur=${COMP_WORDS[COMP_CWORD]} + prev=${COMP_WORDS[COMP_CWORD-1]} + + case $prev in + -k) + _filedir + return 0 + ;; + -U) + COMPREPLY=( $( compgen -u $cur ) ) + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-4 -6 -b -B -d -Q -q -s -u -v -a\ + -e -k -p -o -r -t' -- $cur ) ) + else + _known_hosts + fi +} && +complete -F _ntpdate ntpdate + _filedir_xspec() { local IFS cur xspec