dotnet.plugin.zsh 827 Bytes
Newer Older
1
2
# This scripts is copied from (MIT License):
# https://github.com/dotnet/toolset/blob/master/scripts/register-completions.zsh
3

4
5
6
_dotnet_zsh_complete() 
{
  local completions=("$(dotnet complete "$words")")
7

8
9
10
11
12
13
  # If the completion list is empty, just continue with filename selection
  if [ -z "$completions" ]
  then
    _arguments '*::arguments: _normal'
    return
  fi
14

15
16
  # This is not a variable assigment, don't remove spaces!
  _values = "${(ps:\n:)completions}"
17
18
}

19
compdef _dotnet_zsh_complete dotnet
20

21
22
# Aliases bellow are here for backwards compatibility
# added by Shaun Tabone (https://github.com/xontab) 
23
24
25
26

alias dn='dotnet new'
alias dr='dotnet run'
alias dt='dotnet test'
27
28
alias dw='dotnet watch'
alias dwr='dotnet watch run'
29
30
31
32
alias ds='dotnet sln'
alias da='dotnet add'
alias dp='dotnet pack'
alias dng='dotnet nuget'