Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#158) Error on list -lo without -r #3172

Merged
merged 1 commit into from
May 30, 2023

Conversation

vexx32
Copy link
Member

@vexx32 vexx32 commented May 30, 2023

Description Of Changes

  • list -lo without -r is a hard error
  • list -lo -r is a quiet warning (to logs only) and allows the command to continue unaffected
  • list -li -r similarly to the above, but also includes installed programs from programs and features

Motivation and Context

For compat with existing tooling, we want -r to keep working, but for interactive use we want to error so users are properly aware that this functionality has changed.

Testing

  1. Run choco list -lo -r
  2. Ensure the list comes back without issue
  3. Inspect the log file to be sure the warning is emitted correctly, there should be no linebreak between the log label and the warning
  4. Run choco list -lo
  5. A hard error should be emitted and choco should exit with 1
  6. Run choco list -li -r
  7. The list of packages should be returned and choco should exit cleanly (-r doesn't really support add/remove programs)

Operating Systems Testing

Win11

Change Types Made

  • Bug fix (non-breaking change).
  • Feature / Enhancement (non-breaking change).
  • Breaking change (fix or feature that could cause existing functionality to change).
  • Documentation changes.
  • PowerShell code changes.

Change Checklist

  • Requires a change to the documentation.
  • Documentation has been updated.
  • Tests to cover my changes, have been added.
  • All new and existing tests passed?
  • PowerShell code changes: PowerShell v2 compatibility checked?

Related Issue

#158

@vexx32 vexx32 requested a review from gep13 May 30, 2023 14:23
For compat with existing tooling, we want -r to keep working, but for
interactive use we want to error so users are properly aware that this
functionality has changed.
@vexx32 vexx32 force-pushed the hard-error-on-list-lo branch from fc99a98 to 202f7d6 Compare May 30, 2023 14:31
Copy link
Member

@gep13 gep13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@gep13 gep13 merged commit ebef819 into chocolatey:master May 30, 2023
@gep13
Copy link
Member

gep13 commented May 30, 2023

@vexx32 thanks for getting this fixed up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants