[Bash-completion-devel] Bug#537139: initramfs-tools: please include update-initramfs bash completion

Michael Prokop mika at debian.org
Tue Jun 8 12:42:07 UTC 2010


Hi,

dear Bash Completion Maintainers, can you please check out the
attached bash completion (#537139)? I'm not a bash user and can't
judge whether that's the way to go or anything should be changed.

Should we add this to package initramfs-tools or would you mind
adding it to bash-completion?

thanks && regards,
-mika-

* Stephane Jourdois <kwisatz at kwi.fr> [Mit Jul 15, 2009 at 02:28:31 +0200]:

> Please install the following as /etc/bash_completion.d/initramfs-tools
> to enable bash completion for update-initramfs :

> --------------------------------------------------
> # update-initramfs(8) completion
> # provided by Stéphane (kwisatz) Jourdois <stephane at jourdois.fr>

> _update_initramfs()
> {
>         local cur prev valid_options

>         cur=`_get_cword`
>         prev=${COMP_WORDS[COMP_CWORD-1]}

> 	# The only option that takes an argument is -k
>         if [[ "$prev" == '-k' ]]; then
> 		# Complete with kernel versions
>                 _kernel_versions
>                 return;
>         fi

> 	# Complete with available options (obtained from -h)
>         valid_options=$( update-initramfs -h 2>&1 | \
> 		sed -e '/^ -/!d;s/^ \(-\w\+\).*/\1/' )
>         COMPREPLY=( $( compgen -W "$valid_options" -- $cur ) )
> }
> complete -F _update_initramfs update-initramfs
> --------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/bash-completion-devel/attachments/20100608/88b7216e/attachment.pgp>


More information about the Bash-completion-devel mailing list