Skip to content

Commit 5c93ebf

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 0e6bca6 commit 5c93ebf

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ public virtual IEnumerable<PackageResult> list_run(ChocolateyConfiguration confi
142142
foreach (var pkg in NugetList.GetPackages(config, _nugetLogger))
143143
{
144144
var package = pkg; // for lamda access
145+
string packageArgumentsUnencrypted = null;
145146

146147
if (!string.IsNullOrWhiteSpace(config.Version))
147148
{
@@ -171,6 +172,7 @@ public virtual IEnumerable<PackageResult> list_run(ChocolateyConfiguration confi
171172
}
172173
}
173174

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

176178
if (!config.QuietOutput)
@@ -195,7 +197,7 @@ public virtual IEnumerable<PackageResult> list_run(ChocolateyConfiguration confi
195197
Tags: {9}
196198
Software Site: {10}
197199
Software License: {11}{12}{13}{14}{15}{16}
198-
Description: {17}{18}
200+
Description: {17}{18}{19}
199201
".format_with(
200202
package.Title.escape_curly_braces(),
201203
package.Published.GetValueOrDefault().UtcDateTime.ToShortDateString(),
@@ -229,10 +231,10 @@ public virtual IEnumerable<PackageResult> list_run(ChocolateyConfiguration confi
229231
packageLocalMetadata != null && packageLocalMetadata.BugTrackerUrl != null && !string.IsNullOrWhiteSpace(packageLocalMetadata.BugTrackerUrl.to_string()) ? "{0} Issues: {1}".format_with(Environment.NewLine, packageLocalMetadata.BugTrackerUrl.to_string()) : string.Empty,
230232
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,
231233
package.Description.escape_curly_braces().Replace("\n ", "\n").Replace("\n", "\n "),
232-
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
234+
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,
235+
package.ReleaseNotes != null && !string.IsNullOrWhiteSpace(package.ReleaseNotes.to_string()) ? "{0} Release Notes: {1}".format_with(Environment.NewLine, package.ReleaseNotes.escape_curly_braces().Replace("\n ", "\n").Replace("\n", "\n ")) : string.Empty,
236+
packageArgumentsUnencrypted != null ? packageArgumentsUnencrypted : string.Empty
233237
));
234-
235-
236238
}
237239
else
238240
{

0 commit comments

Comments
 (0)