[pulseaudio-discuss] [PATCH] shell-completion: Add completion for parec
Tanu Kaskinen
tanu.kaskinen at linux.intel.com
Sun May 25 00:53:40 PDT 2014
On Sat, 2014-05-24 at 22:06 +0200, Damir Jelić wrote:
> On Sat, May 24, 2014 at 01:05:52PM +0300, Tanu Kaskinen wrote:
> > ---
> > shell-completion/pulseaudio-bash-completion.sh | 2 +-
> > shell-completion/pulseaudio-zsh-completion.zsh | 1 +
> > 2 files changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/shell-completion/pulseaudio-bash-completion.sh b/shell-completion/pulseaudio-bash-completion.sh
> > index 43f4a2c..7775b08 100644
> > --- a/shell-completion/pulseaudio-bash-completion.sh
> > +++ b/shell-completion/pulseaudio-bash-completion.sh
> > @@ -492,7 +492,7 @@ _pacat () {
> > ;;
> > esac
> > }
> > -complete -F _pacat pacat paplay parecord
> > +complete -F _pacat pacat paplay parec parecord
>
> ACK.
>
> > _pulseaudio()
> > {
> > diff --git a/shell-completion/pulseaudio-zsh-completion.zsh b/shell-completion/pulseaudio-zsh-completion.zsh
> > index abc443a..4101a21 100644
> > --- a/shell-completion/pulseaudio-zsh-completion.zsh
> > +++ b/shell-completion/pulseaudio-zsh-completion.zsh
> > @@ -541,6 +541,7 @@ _pulseaudio() {
> > pacmd) _pacmd_completion;;
> > pacat) _pacat_completion;;
> > paplay)_pacat_completion;;
> > + parec) _pacat_completion;;
> > parecord)_pacat_completion;;
> > padsp) _padsp_completion;;
> > pasuspender) _pasuspender_completion;;
>
> This one needs a little bit more work. The first line in the file
> defines all the 'commands' that this completion file supports (the
> #compdef one).
>
> The _pulseaudio function is just a dispatcher function that looks up the
> name of the calling command ($service is equivalent to argv[0]) and
> calls the real worker functions, so this part is ok but the _devices
> function uses $service as well to complete based on context, e.g.
> when we complete devices for parec we only want sources, for paplay only sinks.
>
> Modified patch attached.
Thanks! I applied the modified patch.
--
Tanu
More information about the pulseaudio-discuss
mailing list