Skip to content

Commit bca15cd

Browse files
committed
(#1310) List remembered arguments
This adds the listing of remembered arguments to the list/info commands It only grabs the arguments when --local-only is specified, then decrypts and outputs them. Requires --verbose to be listed on the command line.
1 parent d700d5c commit bca15cd

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/chocolatey/infrastructure.app/services/NugetService.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ public virtual IEnumerable<PackageResult> list_run(ChocolateyConfiguration confi
150150
foreach (var pkg in NugetList.GetPackages(config, _nugetLogger))
151151
{
152152
var package = pkg; // for lamda access
153+
string packageArgumentsUnencrypted = null;
153154

154155
if (!string.IsNullOrWhiteSpace(config.Version))
155156
{
@@ -179,6 +180,7 @@ public virtual IEnumerable<PackageResult> list_run(ChocolateyConfiguration confi
179180
}
180181
}
181182

183+
packageArgumentsUnencrypted = "\n Remembered Package Arguments: " + (packageInfo.Arguments.contains(" --") && packageInfo.Arguments.to_string().Length > 4 ? packageInfo.Arguments : NugetEncryptionUtility.DecryptString(packageInfo.Arguments));
182184
}
183185

184186
if (!config.QuietOutput)
@@ -203,7 +205,7 @@ public virtual IEnumerable<PackageResult> list_run(ChocolateyConfiguration confi
203205
Tags: {9}
204206
Software Site: {10}
205207
Software License: {11}{12}{13}{14}{15}{16}
206-
Description: {17}{18}
208+
Description: {17}{18}{19}
207209
".format_with(
208210
package.Title.escape_curly_braces(),
209211
package.Published.GetValueOrDefault().UtcDateTime.ToShortDateString(),
@@ -237,10 +239,9 @@ public virtual IEnumerable<PackageResult> list_run(ChocolateyConfiguration confi
237239
packageLocalMetadata != null && packageLocalMetadata.BugTrackerUrl != null && !string.IsNullOrWhiteSpace(packageLocalMetadata.BugTrackerUrl.to_string()) ? "{0} Issues: {1}".format_with(Environment.NewLine, packageLocalMetadata.BugTrackerUrl.to_string()) : string.Empty,
238240
package.Summary != null && !string.IsNullOrWhiteSpace(package.Summary.to_string()) ? "{0} Summary: {1}".format_with(Environment.NewLine, package.Summary.escape_curly_braces().to_string()) : string.Empty,
239241
package.Description.escape_curly_braces().Replace("\n ", "\n").Replace("\n", "\n "),
240-
packageLocalMetadata != null && packageLocalMetadata.ReleaseNotes != null && !string.IsNullOrWhiteSpace(packageLocalMetadata.ReleaseNotes.to_string()) ? "{0} Release Notes: {1}".format_with(Environment.NewLine, packageLocalMetadata.ReleaseNotes.escape_curly_braces().Replace("\n ", "\n").Replace("\n", "\n ")) : string.Empty
242+
packageLocalMetadata != null && packageLocalMetadata.ReleaseNotes != null && !string.IsNullOrWhiteSpace(packageLocalMetadata.ReleaseNotes.to_string()) ? "{0} Release Notes: {1}".format_with(Environment.NewLine, packageLocalMetadata.ReleaseNotes.escape_curly_braces().Replace("\n ", "\n").Replace("\n", "\n ")) : string.Empty,
243+
packageArgumentsUnencrypted != null ? packageArgumentsUnencrypted : string.Empty
241244
));
242-
243-
244245
}
245246
else
246247
{

0 commit comments

Comments
 (0)