introduce dotnet complete command

This commit is contained in:
jonsequitur 2017-03-02 19:36:51 -08:00
parent 2048940760
commit d40a87bc44
9 changed files with 650 additions and 2 deletions

View file

@ -0,0 +1,15 @@
#!/bin/bash
# Parameter completion for the dotnet CLI
_dotnet_bash_complete()
{
local word=${COMP_WORDS[COMP_CWORD]}
local dotnetPath=${COMP_WORDS[1]}
local completions=("$(./bin/Debug/netcoreapp1.0/osx.10.11-x64/publish/dotnet complete --position ${COMP_POINT} "${COMP_LINE}")")
# https://www.gnu.org/software/bash/manual/html_node/Programmable-Completion-Builtins.html
COMPREPLY=( $(compgen -W "$completions" -- "$word") )
}
complete -f -F _dotnet_bash_complete dotnet

View file

@ -0,0 +1,6 @@
Register-ArgumentCompleter -Native -CommandName dotnet -ScriptBlock {
param($commandName, $wordToComplete, $cursorPosition)
C:\dev\github\cli\artifacts\win10-x64\stage2\dotnet.exe complete --position $cursorPosition "$wordToComplete" | ForEach-Object {
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
}
}

View file

@ -0,0 +1,12 @@
# Parameter completion for the dotnet CLI
_dotnet_zsh_complete()
{
local dotnetPath=$words[1]
local completions=("$(./bin/Debug/netcoreapp1.0/osx.10.11-x64/publish/dotnet complete "$words")")
reply=( "${(ps:\n:)completions}" )
}
compctl -K _dotnet_zsh_complete dotnet