Skip to content

Commit 10bcd79

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 9fa89d3 commit 10bcd79

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ public virtual IEnumerable<PackageResult> list_run(ChocolateyConfiguration confi
130130
foreach (var pkg in NugetList.GetPackages(config, _nugetLogger))
131131
{
132132
var package = pkg; // for lamda access
133+
string packageArgumentsUnencrypted = null;
133134

134135
if (!string.IsNullOrWhiteSpace(config.Version))
135136
{
@@ -146,6 +147,7 @@ public virtual IEnumerable<PackageResult> list_run(ChocolateyConfiguration confi
146147
package.OverrideOriginalVersion(packageInfo.VersionOverride);
147148
}
148149
}
150+
packageArgumentsUnencrypted = "\n Remembered Package Arguments: " + (packageInfo.Arguments.contains(" --") && packageInfo.Arguments.to_string().Length > 4 ? packageInfo.Arguments : NugetEncryptionUtility.DecryptString(packageInfo.Arguments));
149151
}
150152

151153
if (!config.QuietOutput)
@@ -170,7 +172,7 @@ Package url
170172
Tags: {8}
171173
Software Site: {9}
172174
Software License: {10}{11}{12}{13}{14}{15}
173-
Description: {16}{17}
175+
Description: {16}{17}{18}
174176
".format_with(
175177
package.Title.escape_curly_braces(),
176178
package.Published.GetValueOrDefault().UtcDateTime.ToShortDateString(),
@@ -201,7 +203,8 @@ Package url
201203
package.BugTrackerUrl != null && !string.IsNullOrWhiteSpace(package.BugTrackerUrl.to_string()) ? "{0} Issues: {1}".format_with(Environment.NewLine, package.BugTrackerUrl.to_string()) : string.Empty,
202204
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,
203205
package.Description.escape_curly_braces().Replace("\n ", "\n").Replace("\n", "\n "),
204-
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
206+
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,
207+
packageArgumentsUnencrypted != null ? packageArgumentsUnencrypted : string.Empty
205208
));
206209
}
207210
else

0 commit comments

Comments
 (0)