From 6b66db74364a2e2d72791a5193e45f72b4435943 Mon Sep 17 00:00:00 2001 From: jonsequitur Date: Mon, 6 Mar 2017 12:08:26 -0800 Subject: [PATCH] a few small code cleanups --- scripts/register-completions.bash | 5 ++--- scripts/register-completions.ps1 | 3 ++- scripts/register-completions.zsh | 4 ++-- src/dotnet/CommonOptions.cs | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/register-completions.bash b/scripts/register-completions.bash index 635e59112..b4753def3 100644 --- a/scripts/register-completions.bash +++ b/scripts/register-completions.bash @@ -1,14 +1,13 @@ #!/bin/bash -# Parameter completion for the dotnet CLI +# 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}")") + local completions=("$(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") ) } diff --git a/scripts/register-completions.ps1 b/scripts/register-completions.ps1 index cc19f9702..58023e52b 100644 --- a/scripts/register-completions.ps1 +++ b/scripts/register-completions.ps1 @@ -1,6 +1,7 @@ +# PowerShell parameter completion shim for the dotnet CLI 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 { + dotnet.exe complete --position $cursorPosition "$wordToComplete" | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) } } \ No newline at end of file diff --git a/scripts/register-completions.zsh b/scripts/register-completions.zsh index 727897232..9f290bc68 100644 --- a/scripts/register-completions.zsh +++ b/scripts/register-completions.zsh @@ -1,10 +1,10 @@ -# Parameter completion for the dotnet CLI +# zsh 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")") + local completions=("$(dotnet complete "$words")") reply=( "${(ps:\n:)completions}" ) } diff --git a/src/dotnet/CommonOptions.cs b/src/dotnet/CommonOptions.cs index 7cabd551c..62af13c21 100644 --- a/src/dotnet/CommonOptions.cs +++ b/src/dotnet/CommonOptions.cs @@ -15,10 +15,10 @@ namespace Microsoft.DotNet.Cli public static Option VerbosityOption() => Create.Option("-v|--verbosity", "Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]", - Accept.AnyOneOf("quiet", - "minimal", - "normal", - "detailed")); + Accept.AnyOneOf("q", "quiet", + "m", "minimal", + "n", "normal", + "d", "detailed")); public static ArgumentsRule DefaultToCurrentDirectory(this ArgumentsRule rule) => rule.With(defaultValue: () => PathUtility.EnsureTrailingSlash(Directory.GetCurrentDirectory()));