From dabc2bc577011f11bd95c06632a63290701f1466 Mon Sep 17 00:00:00 2001 From: Petr Onderka Date: Tue, 1 May 2018 11:41:54 +0200 Subject: [PATCH] Simplify completions scripts --- scripts/register-completions.bash | 4 +--- scripts/register-completions.zsh | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/scripts/register-completions.bash b/scripts/register-completions.bash index b4753def3..09d167bd2 100644 --- a/scripts/register-completions.bash +++ b/scripts/register-completions.bash @@ -1,14 +1,12 @@ -#!/bin/bash # bash parameter completion for the dotnet CLI _dotnet_bash_complete() { local word=${COMP_WORDS[COMP_CWORD]} - local dotnetPath=${COMP_WORDS[1]} local completions=("$(dotnet complete --position ${COMP_POINT} "${COMP_LINE}")") COMPREPLY=( $(compgen -W "$completions" -- "$word") ) } -complete -f -F _dotnet_bash_complete dotnet \ No newline at end of file +complete -f -F _dotnet_bash_complete dotnet diff --git a/scripts/register-completions.zsh b/scripts/register-completions.zsh index 9f290bc68..8eebe9a86 100644 --- a/scripts/register-completions.zsh +++ b/scripts/register-completions.zsh @@ -2,11 +2,9 @@ _dotnet_zsh_complete() { - local dotnetPath=$words[1] - local completions=("$(dotnet complete "$words")") reply=( "${(ps:\n:)completions}" ) } -compctl -K _dotnet_zsh_complete dotnet \ No newline at end of file +compctl -K _dotnet_zsh_complete dotnet