Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Adds more translatable strings and removes returns that aren't required.

Co-authored-by: Kim J. Nordmo <[email protected]>
  • Loading branch information
JPRuskin and AdmiringWorm authored Oct 11, 2022
1 parent 1d9b57f commit 0febeca
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,21 @@ namespace chocolatey.infrastructure.app.commands
using System.Text;

[CommandFor("license", "Retrieve or modify the Chocolatey License")]
class ChocolateyLicenseCommand : ICommand
public class ChocolateyLicenseCommand : ICommand
{
public void configure_argument_parser(OptionSet optionSet, ChocolateyConfiguration configuration)
{
// We don't currently expect to have any arguments
return;
}

public void handle_additional_argument_parsing(IList<string> unparsedArguments, ChocolateyConfiguration configuration)
{
// We don't currently expect to have any additional arguments
return;
}

public void handle_validation(ChocolateyConfiguration configuration)
{
// We don't currently accept any arguments, so there is no validation
return;
}

public void help_message(ChocolateyConfiguration configuration)
Expand All @@ -64,7 +61,6 @@ public bool may_require_admin_access()

public void noop(ChocolateyConfiguration configuration)
{
return;
}

public void run(ChocolateyConfiguration config)
Expand All @@ -73,7 +69,14 @@ public void run(ChocolateyConfiguration config)

if (config.RegularOutput)
{
this.Log().Info("We have found a{0}valid license for Chocolatey {1}, which expires {2}".format_with((ourLicense.IsValid ? " " : "n in"), ourLicense.LicenseType, ourLicense.ExpirationDate));
if (ourLicense.IsValid)
{
this.Log().Info("We have found a valid license for Chocolatey {0}, which expires {1}", ourLicense.LicenseType, ourLicense.ExpirationDate);
}
else
{
this.Log().Info("We have found an invalid license for Chocolatey {0}, which expires {1}", ourLicense.LicenseType, ourLicense.ExpirationDate);
}
this.Log().Info("Registered to: {0}".format_with(ourLicense.Name));
this.Log().Info("Expiration Date: {0} UTC".format_with(ourLicense.ExpirationDate));
this.Log().Info("License type: {0}".format_with(ourLicense.LicenseType));
Expand Down

0 comments on commit 0febeca

Please sign in to comment.