Parameters before command does not work as expected
- Dominant language
- C#
- Stars
- 11.5k
- Forks
- 960
- PR merge metrics
- No merged PRs in 30d
Description
### What You Are Seeing?
`choco -y upgrade MyPackage` does not work and does not provide an error message. I used the pycharm package in the example below
### What is Expected?
I would expect `choco -y upgrade MyPackage` to work exactly the same as `choco upgrade -y MyPackage`
### How Did You Get This To Happen? (Steps to Reproduce)
just run `choco -y upgrade MyPackage`
### Output Log
```PowerShell
PS > choco -y upgrade pycharm
Chocolatey v0.10.15 Business
PS >
```
Full Log Output
~~~sh
2020-09-20 15:32:38,888 13140 [DEBUG] - XmlConfiguration is now operational
2020-09-20 15:32:38,901 13140 [DEBUG] - Evaluating license file found at 'C:\ProgramData\chocolatey\license\chocolatey.license.xml'
2020-09-20 15:32:38,914 13140 [DEBUG] - [Licensing] License expiration date is [REDACTED]
2020-09-20 15:32:39,050 13140 [DEBUG] - [Licensing] License expiration date is [REDACTED]
2020-09-20 15:32:39,123 13140 [DEBUG] - Loading Licensed Extensions and Commands
2020-09-20 15:32:39,166 13140 [INFO ] - ============================================================
2020-09-20 15:32:39,235 13140 [DEBUG] - [Licensing] License expiration date is [REDACTED]
2020-09-20 15:32:39,330 13140 [INFO ] - Chocolatey v0.10.15 Business
2020-09-20 15:32:39,339 13140 [DEBUG] - Chocolatey is running on Windows v 10.0.19041.0
2020-09-20 15:32:39,341 13140 [DEBUG] - Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
2020-09-20 15:32:39,343 13140 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
2020-09-20 15:32:39,349 13140 [DEBUG] - Command line: "C:\ProgramData\chocolatey\choco.exe" -y upgrade pycharm
2020-09-20 15:32:39,351 13140 [DEBUG] - Received arguments: -y upgrade pycharm
2020-09-20 15:32:39,388 13140 [DEBUG] - RemovePendingPackagesTask is now ready and waiting for PreRunMessage.
2020-09-20 15:32:39,391 13140 [DEBUG] - CountdownTask is now ready and waiting for PostRunMessage.
2020-09-20 15:32:39,393 13140 [DEBUG] - Terminal services setup not necessary for this session.
2020-09-20 15:32:39,396 13140 [DEBUG] - SynchronizeTask is now ready and waiting for PreRunMessage.
2020-09-20 15:32:39,397 13140 [DEBUG] - AdminOnlyFeatureTask is now ready and waiting for PreRunMessage.
2020-09-20 15:32:39,399 13140 [DEBUG] - PackagesInProgramsAndFeaturesTask is now ready and waiting for PostRunMessage.
2020-09-20 15:32:39,405 13140 [DEBUG] - Sending message 'PreRunMessage' out if there are subscribers...
2020-09-20 15:32:39,410 13140 [DEBUG] - [Pending] Removing all pending packages that should not be considered installed...
2020-09-20 15:32:39,455 13140 [DEBUG] - [Synchronize] Updating packages with Programs and Features
2020-09-20 15:32:39,457 13140 [DEBUG] - [Synchronize] Currently only supports removals. Soon will handle updates.
[REMOVED MASSIVE LIST OF INSTALLED PACKAGES]
[REMOVED SOME MESSAGES ABOUT OUT OF SYNC]
2020-09-20 15:32:40,730 13140 [DEBUG] - [Admin Only] Ensuring only admins can execute choco commands.
2020-09-20 15:32:40,760 13140 [DEBUG] - Sending message 'PostRunMessage' out if there are subscribers...
2020-09-20 15:32:40,762 13140 [DEBUG] - [Countdown] Determining how long until license expires
[REMOVED MASSIVE LIST OF INSTALLED PACKAGES]
2020-09-20 15:32:41,936 13140 [DEBUG] - [Programs & Features Package Sync] Ensuring all installed packages that don't have software natively installed are not listed in Programs and Features.
[REMOVED MASSIVE LIST OF INSTALLED PACKAGES]
2020-09-20 15:32:43,058 13140 [DEBUG] - Exiting with 1
~~~
Contributor guide
Research direction
Reproduce both `choco -y upgrade pycharm` and `choco upgrade -y pycharm`, then trace the command-line argument parsing from the received arguments shown in the log. Done means parameters before the command behave like the equivalent parameters after it, with a regression test covering both forms.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100