meganz / MEGAcmd

Command Line Interactive and Scriptable Application to access MEGA
Other
1.92k stars 406 forks source link

Improve showpcr output #101

Closed steve4444 closed 5 years ago

steve4444 commented 5 years ago

The output of showpcr --in and showpcr --out shows a header conditional on whether there are actual requests. This header is useless when --in or --out are passed. Also, it makes the output inconsistent and therefore difficult to parse.

To clarify, in PowerShell set:

$x=& $megacmd  showpcr --out

With a fixed header one would extract emails with:

$x[1..$x.Length] | % {$_.Split("(")[0].Trim()}

Even better, without any header

$x | % {$_.Split("(")[0].Trim()}
polmr commented 5 years ago

Headers are there to qualify. You can always filter them out. I'd suggest you do something like:


$x | ?{$_ -notmatch 'PCRs:'}