-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[Feature] Make scoop info
accept pipeline input as object-stream in the powershell spirit
#4889
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
Comments
The output of something like |
The use case would be whenever user is interested in apps and queries/explores out of curiosity. It helps by PS C:\WINDOWS\system32> Measure-Command -Expression {scoop search}
'extras' bucket:
'java' bucket:
'main' bucket:
Days : 0
Hours : 0
Minutes : 0
Seconds : 6
Milliseconds : 212
Ticks : 62129437
TotalDays : 7.19090706018518E-05
TotalHours : 0.00172581769444444
TotalMinutes : 0.103549061666667
TotalSeconds : 6.2129437
TotalMilliseconds : 6212.9437
PS C:\WINDOWS\system32> scoop search | Measure-Object
'extras' bucket:
'java' bucket:
'main' bucket:
Count : 2713
Average :
Sum :
Maximum :
Minimum :
Property :
ps.1. I was checking out https://rasa.github.io/scoop-directory/by-bucket#ScoopInstaller_Main . Awesome website. ps.2. Additionally maybe expand command line syntax to
|
The command But I do like the idea of converting the output of |
Definitely not 4 hrs. The unoptimized scriptlet given in the description took about 33 minutes. The gain is perhaps happen due to exe-caching, dir-list-caching or file-system caching. So script-time for single invocation script will be bounded between 7 sec and 33 minutes. If, I were to take a guess, it would be around 30 sec. (edit: guess turns out to be wrong, but that raised more questions, but 15 min is better than 33 min, ie. saving of 18 min) This was my thinking: I have 3 buckets main, extras, java, so around 2700 app manifest. In the given scriptlet, in I experimented and attempted some measurements
*EDIT:
This happened because there are 4 apps with names |
The bulk of time taken by |
I moved the git-using chunks of code that determine properties ... Finishes in 37 seconds as expected.
Here-on-out, as to what to do (create an optarg/create a static json/etc), its in the realm of your decision space. |
scoop info
accept pipeline input as object-stream in the powershell spirit
Bug Report
I filed this as a bug instead of as a feature, as the inability to do so is a bit glaring. The general powershell philosophy (in contrast to that of unix-shell) is that the output should be a object stream.
Current Behavior
No way to get an
scoop info *
object stream.So i tried to work around it using
scoop search
whose output is a mix of text-stream, perhaps a mix of console-host text-stream and debug/error text-streamConsider how long the following script takes : 33 minutes on my i7-haswell laptop, with scoop on HDD.
The
$_.P2.ToString()
was required to avoid wrong-type-expected-errors, as app-names with length of single-char would have typeSystemValue.Char
instead ofString
.The output-file is that I was interested is for your perusal scoop_search_op.txt
My motivation to write the above, was to introduce myself to many apps/commands that I had not heard of. There are so many apps/commands in scoop. (which is good!). When I do a
scoop update
and see app-manifests list of an updated scoop-bucket of apps other than what I have installed, I am interested in knowing what those apps are, just to learn about and know if some app may be useful to me. I could do scoop info by manually typing for each such curiosity. I wonder if there is some easy way to capturescoop update
and do ascoop info
on them. Unsure if you'd see that as a sufficiently valuable feature-add.The above script takes a long time to finish. The trouble is: that powershell has to do a second command invocation
scoop info
, which could have been avoided if there was a way to get an object-stream output.scoop info
does not take*
as an argument, i.e. there is noscoop info "*"
If
scoop search/scoop info *
output a object stream, and if the objects had suitable default to-string() printing, then the output-objects can more quickly and easily parsed and complex queries can be performed.This could in theory apply to any scoop sub-command that has informative output.
Expected Behavior
An object stream is more rapidly processable by powershell. Objects can be manipulated by methods and properties.
Additional context/output
An example scoop info output
Possible Solution
perhaps, an implementation of
scoop info *
would internally invokescoop search
and output an object stream ofscoop info
in a manner similar to the script suggested above. This would be more performant.System details
Windows version: [e.g. 7, 8, 10]
10
OS architecture: [e.g. 32bit, 64bit]
64bit
PowerShell version: [output of
"$($PSVersionTable.PSVersion)"
]Additional software: [(optional) e.g. ConEmu, Git]
Scoop Configuration
NA
//# Your configuration here
The text was updated successfully, but these errors were encountered: