From cc84b8402d0a607e0d7926e0f3923134dad5c237 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 3 Jan 2017 11:16:34 -0800 Subject: [PATCH] Fix help text for dotnet-user-secrets-set to show the correct Windows example --- .../Internal/SetCommand.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.Extensions.SecretManager.Tools/Internal/SetCommand.cs b/src/Microsoft.Extensions.SecretManager.Tools/Internal/SetCommand.cs index c162b72107..5c393f3223 100644 --- a/src/Microsoft.Extensions.SecretManager.Tools/Internal/SetCommand.cs +++ b/src/Microsoft.Extensions.SecretManager.Tools/Internal/SetCommand.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.IO; +using System.Runtime.InteropServices; using System.Text; using Microsoft.Extensions.CommandLineUtils; using Microsoft.Extensions.Tools.Internal; @@ -18,9 +19,13 @@ Additional Info: This command will also handle piped input. Piped input is expected to be a valid JSON format. Examples: - dotnet user-secrets set ConnStr ""User ID=bob;Password=***"" - cat secrets.json | dotnet user-secrets set -"; + dotnet user-secrets set ConnStr ""User ID=bob;Password=***"""; + + var catCmd = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) + ? @"type .\secrets.json" + : "cat ./secrets.json"; + + command.ExtendedHelpText += $@" {catCmd} | dotnet user-secrets set"; command.HelpOption();