On Thu, 1 Aug 2019, Artur Tarassow wrote:
I also think that implementing it natively either through a function
or
command extension is the right way. adding an option to the pkg command looks
quite natural to me.
Here's what's in current git (snapshots and documentation to
follow): there's a new "query" action for the pkg command. By
default it prints information and stores nothing, but with the
--quiet option it prints nothing and stores a $result bundle.
An illustration (I've redacted the "email" output):
<hansl>
pkg query ghosts
pkg query ghosts --quiet
eval $result
if inbundle($result, "depends")
eval $result.depends
endif
pkg query invisible
pkg query invisible --quiet
eval $result
</hansl>
<output>
? pkg query ghosts
File: /opt/esl/share/gretl/functions/ghosts/ghosts.gfn
Package: ghosts 0.3 (2019-04-24)
Author: Riccardo "Jack" Lucchetti
Required gretl version: 2018b (20181)
Data requirement: none
Description: Multivariate spectra
Dependencies: cmatrix
? pkg query ghosts --quiet
? eval $result
bundle anonymous:
author = Riccardo "Jack" Lucchetti
date = 2019-04-24
file = /opt/esl/share/gretl/functions/ghosts/ghosts.gfn
name = ghosts
data_requirement = none
depends = array of strings, length 1
version = 0.3
description = Multivariate spectra
gretl_version = 20181
? eval $result.depends
Array of strings, length 1
[1] "cmatrix"
? pkg query invisible
invisible: not found
? pkg query invisible --quiet
? eval $result
bundle anonymous:
not_found = 1
</output>
Allin