json: Add direct way to query a config option
authorAndre Heinecke <aheinecke@intevation.de>
Thu, 7 Jun 2018 09:42:47 +0000 (11:42 +0200)
committerAndre Heinecke <aheinecke@intevation.de>
Thu, 7 Jun 2018 09:42:47 +0000 (11:42 +0200)
commit906ea48df3e178bea3e2c744ddd834b23fe553fb
tree4b7134a20794c5a1b09f4674c8a8f94f5128b539
parent7e18c7a07a1e2c58ef4d5ddeed46bcce098bdf6c
json: Add direct way to query a config option

* src/gpgme-json.c (op_config_opt, hlp_config_opt): New operation.
(process_request, hlp_help): Add it.

--
This is more conveniant API for most query operations where
a single option is required.

An example would be:
{
    "op": "config_opt",
    "component": "gpg",
    "option": "default-key"
}

Which results in:
{
   "option":       {
           "name": "default-key",
           "description":  "use NAME as default secret key",
           "argname":      "NAME",
           "flags":        0,
           "level":        0,
           "type": 1,
           "alt_type":     1,
           "value":        [{
                           "string":       "F462B6B1",
                           "is_none":      false
                   }]
   }
}
src/gpgme-json.c