json: Improve help meta command in gpgme-json.
* src/gpgme-json.c (process_meta_commands): Add ",help CMD". Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
ed1052842d
commit
49a617f8bb
@ -1156,13 +1156,23 @@ process_meta_commands (const char *request)
|
|||||||
request++;
|
request++;
|
||||||
|
|
||||||
if (!strncmp (request, "help", 4) && (spacep (request+4) || !request[4]))
|
if (!strncmp (request, "help", 4) && (spacep (request+4) || !request[4]))
|
||||||
|
{
|
||||||
|
if (request[4])
|
||||||
|
{
|
||||||
|
char *buf = xstrconcat ("{ \"help\":true, \"op\":\"", request+5,
|
||||||
|
"\" }", NULL);
|
||||||
|
result = process_request (buf);
|
||||||
|
xfree (buf);
|
||||||
|
}
|
||||||
|
else
|
||||||
result = process_request ("{ \"op\": \"help\","
|
result = process_request ("{ \"op\": \"help\","
|
||||||
" \"interactive_help\": "
|
" \"interactive_help\": "
|
||||||
"\"\\nMeta commands:\\n"
|
"\"\\nMeta commands:\\n"
|
||||||
" ,read FNAME Process data from FILE\\n"
|
" ,read FNAME Process data from FILE\\n"
|
||||||
" ,help This help\\n"
|
" ,help CMD Print help for a command\\n"
|
||||||
" ,quit Terminate process\""
|
" ,quit Terminate process\""
|
||||||
"}");
|
"}");
|
||||||
|
}
|
||||||
else if (!strncmp (request, "quit", 4) && (spacep (request+4) || !request[4]))
|
else if (!strncmp (request, "quit", 4) && (spacep (request+4) || !request[4]))
|
||||||
exit (0);
|
exit (0);
|
||||||
else if (!strncmp (request, "read", 4) && (spacep (request+4) || !request[4]))
|
else if (!strncmp (request, "read", 4) && (spacep (request+4) || !request[4]))
|
||||||
|
Loading…
Reference in New Issue
Block a user