diff options
Diffstat (limited to 'plugins/dotnet')
| -rw-r--r-- | plugins/dotnet/README.md | 5 | ||||
| -rw-r--r-- | plugins/dotnet/dotnet.plugin.zsh | 27 |
2 files changed, 13 insertions, 19 deletions
diff --git a/plugins/dotnet/README.md b/plugins/dotnet/README.md index a15e80577..2b06d8810 100644 --- a/plugins/dotnet/README.md +++ b/plugins/dotnet/README.md @@ -1,6 +1,6 @@ -# .NET Core CLI plugin +# .NET CLI plugin -This plugin provides completion and useful aliases for [.NET Core CLI](https://dotnet.microsoft.com/). +This plugin provides completion and useful aliases for [.NET CLI](https://dotnet.microsoft.com/). To use it, add `dotnet` to the plugins array in your zshrc file. @@ -23,3 +23,4 @@ plugins=(... dotnet) | dp | dotnet pack | Create a NuGet package. | | dng | dotnet nuget | Provides additional NuGet commands. | | db | dotnet build | Build a .NET project | +| dres | dotnet restore | Restore dependencies and project-specific tools for a project. | diff --git a/plugins/dotnet/dotnet.plugin.zsh b/plugins/dotnet/dotnet.plugin.zsh index 89d464670..2b7782474 100644 --- a/plugins/dotnet/dotnet.plugin.zsh +++ b/plugins/dotnet/dotnet.plugin.zsh @@ -1,25 +1,17 @@ # This scripts is copied from (MIT License): -# https://github.com/dotnet/toolset/blob/master/scripts/register-completions.zsh +# https://raw.githubusercontent.com/dotnet/sdk/main/scripts/register-completions.zsh -_dotnet_zsh_complete() -{ - local completions=("$(dotnet complete "$words")") - - # If the completion list is empty, just continue with filename selection - if [ -z "$completions" ] - then - _arguments '*::arguments: _normal' - return - fi - - # This is not a variable assignment, don't remove spaces! - _values = "${(ps:\n:)completions}" +#compdef dotnet +_dotnet_completion() { + local -a completions=("${(@f)$(dotnet complete "${words}")}") + compadd -a completions + _files } -compdef _dotnet_zsh_complete dotnet +compdef _dotnet_completion dotnet -# Aliases bellow are here for backwards compatibility -# added by Shaun Tabone (https://github.com/xontab) +# Aliases below are here for backwards compatibility +# added by Shaun Tabone (https://github.com/xontab) alias dn='dotnet new' alias dr='dotnet run' @@ -32,3 +24,4 @@ alias da='dotnet add' alias dp='dotnet pack' alias dng='dotnet nuget' alias db='dotnet build' +alias dres='dotnet restore' |
