Skip to content

Commit 039142a

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 c6e30b7 commit 039142a

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ public virtual IEnumerable<PackageResult> list_run(ChocolateyConfiguration confi
160160
foreach (var pkg in NugetList.GetPackages(config, _nugetLogger, _fileSystem))
161161
{
162162
var package = pkg; // for lamda access
163+
string packageArgumentsUnencrypted = null;
163164

164165
ChocolateyPackageMetadata packageLocalMetadata;
165166
string packageInstallLocation = null;
@@ -184,6 +185,10 @@ public virtual IEnumerable<PackageResult> list_run(ChocolateyConfiguration confi
184185
}
185186
}
186187

188+
if (!string.IsNullOrWhiteSpace(packageInfo.Arguments))
189+
{
190+
packageArgumentsUnencrypted = "\n Remembered Package Arguments: " + (packageInfo.Arguments.contains(" --") && packageInfo.Arguments.to_string().Length > 4 ? packageInfo.Arguments : NugetEncryptionUtility.DecryptString(packageInfo.Arguments));
191+
}
187192
}
188193

189194
if (!config.QuietOutput)
@@ -208,7 +213,7 @@ Package url{6}
208213
Tags: {9}
209214
Software Site: {10}
210215
Software License: {11}{12}{13}{14}{15}{16}
211-
Description: {17}{18}
216+
Description: {17}{18}{19}
212217
".format_with(
213218
package.Title.escape_curly_braces(),
214219
package.Published.GetValueOrDefault().UtcDateTime.ToShortDateString(),
@@ -242,7 +247,8 @@ Package url{6}
242247
!string.IsNullOrWhiteSpace(package.BugTrackerUrl.to_string()) ? "{0} Issues: {1}".format_with(Environment.NewLine, package.BugTrackerUrl.to_string()) : string.Empty,
243248
package.Summary != null && !string.IsNullOrWhiteSpace(package.Summary.to_string()) ? "\r\n Summary: {0}".format_with(package.Summary.escape_curly_braces().to_string()) : string.Empty,
244249
package.Description.escape_curly_braces().Replace("\n ", "\n").Replace("\n", "\n "),
245-
!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
250+
!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,
251+
packageArgumentsUnencrypted != null ? packageArgumentsUnencrypted : string.Empty
246252
));
247253

248254

0 commit comments

Comments
 (0)