scoop-search
scoop-search copied to clipboard
scoop help command raises an exception
When calling scoop help
, PowerShell issues an exception caused by duplicate search
subcommand.
Only happens if scoop-search is currently installed. Tried without a profile and the exception is still raised.
❯ scoop help
Usage: scoop <command> [<args>]
Some useful commands are:
MethodInvocationException: C:\Users\bruno\scoop\apps\scoop\current\libexec\scoop-help.ps1:29
Line |
29 | $commands.add("$command ", $summary) # add padding
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Exception calling "Add" with "2" argument(s): "Item has already been added. Key in
| dictionary: 'search ' Key being added: 'search '"
Oh boy, after researching it apparently it is because of scoop's alias system. scoop-search
gets installed in the same directory as aliases causing scoop to think it is an alias. Long story short it's not really fixable without some horrible workaround.
On the other hand this is a great opportunity to just turn scoop-search
into a scoop alias which would remove the need of adding this awkward powershell hook. However this would mean the name would need to change, to scoop-find
or something like that. In the end it would be a good change, but might be annoying for people to transition.
Any thoughts?
Based on lukesampson/scoop#4239, another possibility would be to improve Scoop's own search system based on your awesome work.
But that's probably a long discussion on the main repo, and may never see the light of day.
If I understand correctly, your idea is to turn scoop-search into an all new scoop subcommand, meaning the user would be able to use either search
(vanilla) or find
(this one). That's a nice idea to implement on the meantime, probably less prone to becoming stuck on an issue for a long time.